Hi folks,
I have ran this system for about 1 month now. it has a 90% winrate with 147 trades. The problem with this system is that the losses is way too big. If someone would have some ideas to improve this I would be greatful
Thanks..
defparam cumulateorders = false
defparam preloadbars = 5000
once positionsize = 1
once tradetype = 2 // [1]long&short;[2]long;[3]short
//========= STRATEGY ===================================
//long
c10=low<lowest[2](low[1])
c11=close<low[1]
tradelong = c10 and c11
//short
c20=high>highest[2](high[1])
c21=close>high[1]
tradeshort = c20 and c21
//=======================================================
// entry
If (tradetype=1 or tradetype=2) and tradelong then
if not onmarket then
buy positionsize contract at market
endif
endif
if (tradetype=1 or tradetype=3) and tradeshort then
if not onmarket then
sellshort positionsize contract at market
endif
endif
//%trailing stop function
trailingPercent = .26 //org .26
stepPercent = .015 //org .014
if onmarket then
trailingstart = tradeprice(1)*(trailingpercent/100) //trailing will start @trailinstart points profit
trailingstep = tradeprice(1)*(stepPercent/100) //% step to move the stop
endif
//reset the stoploss value
IF NOT ONMARKET THEN
newSL=0
ENDIF
//manage long positions
IF LONGONMARKET THEN
//first move (breakeven)
IF newSL=0 AND close-tradeprice(1)>=trailingstart THEN
newSL = tradeprice(1)+trailingstep
ENDIF
//next moves
IF newSL>0 AND close-newSL>trailingstep THEN
newSL = newSL+trailingstep
ENDIF
ENDIF
//manage short positions
IF SHORTONMARKET THEN
//first move (breakeven)
IF newSL=0 AND tradeprice(1)-close>=trailingstart THEN
newSL = tradeprice(1)-trailingstep
ENDIF
//next moves
IF newSL>0 AND newSL-close>trailingstep THEN
newSL = newSL-trailingstep
ENDIF
ENDIF
//stop order to exit the positions
IF newSL>0 THEN
SELL AT newSL STOP
EXITSHORT AT newSL STOP
ENDIF
Try adding a TP & SL at line 32, such as:
SET TARGET pPROFIT 100
SET STOP pLOSS 50
This works pretty good in 1m DOW.
28 wins (all long trades) and zero losses although that’s only over 15000 units. Max DD was £739
Would be good to see a longer period and see what it looks like over varying conditions
You just need to use 100K units to find out.
Select x units, then replace manually 15K with 100K.