good afternoon all,
i need some coding help please.
i would like to add a parameter to the below code which defines how many bars to wait before re-entering a trade – assuming the conditions to trade are still being met.
code is not finalised but being built out bit by bit. will be using 1m bars
// Conditions for Entry of Long Positions
IF CLOSE<EMA(20) AND NOT ONMARKET THEN
BUY 1 CONTRACTS AT MARKET
SET STOP $LOSS StopLoss
ELSIF SHORTONMARKET AND (CLOSE-TRADEPRICE) THEN
BUY 1 CONTRACTS AT MARKET
SET STOP $LOSS StopLoss
ENDIF
Hope it makes sense
thanks in advance