hello,
at the moment iam developing a new stategy and i need your coding support.
i’m looking for the code snippet to define that my long position should sell after 4 days.
i only can found thinks like sell after x pipes or soething like this, but i only need the command to sell my long position after 4 days
greetings
If you are trading on a daily timeframe, you can test if the actual trade has 4 bars elapsed since its inception. You should look at TRADEINDEX in the documentation.
Hi Nicolas,
thank you very much!
IF LONGONMARKET AND (BarIndex – TradeIndex) >= 4 THEN
SELL AT MARKET
ENDIF