Hello,
Below is a snippet of my code. In this strategy if the trade hits stoploss it’ll re-enter in the opposite direction (max 2 trades per day). I’ve now added a trailing stop, however I still want the opposite trade to execute as long as it hasn’t hit “SET TARGET pPROFIT”. So at the moment, if it hits the trailing stop in profit nothing happens, but I want it to re-enter.
Hope that makes sense, any help much appreciated.
// Conditions to enter short positions
c2 = (lpm[1] >= close)
IF c2 AND timeEnterBefore AND timeEnterAfter AND not daysForbiddenEntry AND count<1 THEN
SELLSHORT 3.75 PERPOINT AT MARKET
SET STOP pLOSS 2
SET TARGET pPROFIT 13
count = count + 1
ENDIF
//check profit
If StrategyProfit < StrategyProfit[1] then
If LongOnMarket[1] AND Not OnMarket AND count=1 then
Sellshort 3.75 PERPOINT AT MARKET
SET STOP pLOSS 3
SET TARGET pPROFIT 10
count = count + 1
Elsif shortonmarket[1] AND Not OnMarket and count=1 then
BUY 3.75 PERPOINT AT MARKET
SET STOP pLOSS 3
SET TARGET pPROFIT 10
count = count + 1
Endif
Endif