After Sold 2 lots, I want to Buy 1 lot as primary target for commodity future. I have made condition as shown in above image.
the code is
( tt_get_var ( tt_get_future_instrument ( ‘Crudeoil’ ) , ‘LTP’ ) <= ( tt_get_runtime ( ‘strategy_id’, ‘Crudeoil’, ‘EntryPrice’ ) - get_runtime ( ‘strategy_id’, ‘run_counter’, ‘vprimary’ ) ) )
I get the runtime value of variable “vprimary” from tradingview and compare it with LTP.
But it is not working properly.
Can anyone tell me the change in condition.