Help me to code this strategy

I am trying to create a BankNifty option sell strategy but of no luck. If anyone can help me out that will be great. The following is the details about the strategy that I want to code in Tradetron

Entry Time: 9.30

Parameters Required:

  1. Prev. Day High
  2. Prev. Day Low
  3. Current Day High at 9.30
  4. Current Day Low at 9.30

Calculations that I want to do are as follows:

Prev. Day Range = Prev. Day High - Prev. Day Low
Current Range = Current Day High at 9.30 - Current Day Low at 9.30

Final Range = (Prev. Day Range - Current Range)*some_constant_number

Call Strike = Prev. Day Close + Final Range
Put Strike = Prev. Day Close - Final Range

The output of call strike and put strike I want to sell using the algo

1 Like

call strike price

thanks for the answer…

I am trying to round-up the result of the expression that is given above to the nearest strike available in its option. For example, if the calculated value is 29,817.85 then it should round-up and give me the 29900 as the final strike that I want to use.

I tried using ROUND from Math but unbale to parse the entire expression into it, if any one can help me out with that…???