Algo to get the difference of two LastTradedPrice options <= 50%

Hi Team,

i am trying to get the difference of two LastTradedPrice options, alert should be trigged if it reaches <= 50%
Bascially, alert should trigger if the difference between two LastTradedPrice reaches <=50%

Below is the example i am trying please help me to correct it

LastTradedPrice(‘NFO:BANKNIFTY2161036700CE’) - LastTradedPrice(‘NFO:BANKNIFTY2161034600PE’) <= 0.5 || LastTradedPrice(‘NFO:BANKNIFTY2161034600PE’) - LastTradedPrice(‘NFO:BANKNIFTY2161036700CE’) <=0.5

1 Like

Hi,

Since, you are specifying 50% which is a relative term, you will also need to mention a variable [e.g., 50% of X] or a constant [e.g., 50% of 100], in the condition. Therefore, in your case, if you need the argument to be “<= 50%” of the Last Traded Price of security X, the relevant syntax would be something like “<= 0.5 * LastTradedPrice[X]”.

Also, you can refer to this page for any queries, in relation to the framing of syntax.

1 Like