I built this simple strategy with VWAP series but trade has not been triggered. Below are the conditions:
- previous 3 minute candle is above VWAP
- previous to previous candle also above VWAP.
- 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 !