Trade not triggered with this code

I built this simple strategy with VWAP series but trade has not been triggered. Below are the conditions:

  1. previous 3 minute candle is above VWAP
  2. previous to previous candle also above VWAP.
  3. both candles (-1 & -2) are green.

here is the code:
( Position ( OPEN ( Symbol ( Instrument Name ( ‘NFO,NIFTY BANK,’ ) , ‘3m’, ‘All’ ) ) , ‘-1’ ) > Position ( VWAP Series ( Instrument Name ( ‘NFO,NIFTY BANK,’ ) , ‘3m’ ) , ‘-1’ ) ) and ( Position ( OPEN ( Symbol ( Instrument Name ( ‘NFO,NIFTY BANK,’ ) , ‘3m’, ‘All’ ) ) , ‘-2’ ) > Position ( VWAP Series ( Instrument Name ( ‘NFO,NIFTY BANK,’ ) , ‘3m’ ) , ‘-2’ ) ) and ( Position ( OPEN ( Symbol ( Instrument Name ( ‘NFO,NIFTY BANK,’ ) , ‘3m’, ‘All’ ) ) , ‘-1’ ) < Position ( CLOSE ( Symbol ( Instrument Name ( ‘NFO,NIFTY BANK,’ ) , ‘3m’, ‘All’ ) ) , ‘-1’ ) ) and ( Position ( OPEN ( Symbol ( Instrument Name ( ‘NFO,NIFTY BANK,’ ) , ‘3m’, ‘All’ ) ) , ‘-2’ ) < Position ( CLOSE ( Symbol ( Instrument Name ( ‘NFO,NIFTY BANK,’ ) , ‘3m’, ‘All’ ) ) , ‘-2’ ) )

Please let me know if there is any issue with this code. Thank you !

I think you should check close > vwap

1 Like

Thanks for the reply! You may be true but then why it is not triggering for ‘Open > VWAP’. I may not get the desired result but at least trade should trigger.

VWAP can not be used with spot price. Use future price.

1 Like

But wouldn’t it affect the result because i’m buying a Call or Put option.

VWAP uses volume. Only futures has volume. Spot doesn’t. PE and CE price you can take it based on Spot price

1 Like

So you mean to say while defining the Conditions, i would use futures but while defining the Positions, i would select Call/Put options?

Yes. That’s correct.

1 Like

Thank you so much for your time !

How to get FUTs price in this case. in Instrument Name ( ‘NFO,NIFTY BANK,’ ) i don’t see any other option for FUTURE?
can you please guide?

Select current month

1 Like