Manel I didn’t notice your post when I replied from my phone.. I can understand why the backrest is only working for current market conditions. It needs smooth movements and if the market becomes more volatile it will not work anymore. If you have any idea in how to compensate this shortcoming please let me know!
An idea that I have is to try is to restrict long and short slightly depending on trend, right now they are working slightly more as a mean reverse.
You say ... if the market becomes more volatile it will not work anymore … that is not a bad thing unless you can ensure that trades are on the right side of the volatility?
Alternatively get out quick using a stop dependent on a condition which is a measure of volatlilty?
If Shortonmarket AND ‘volatile measure’ AND Price > Price[1] AND Price[1] > Price[2] etc (i.e Price increasing) THEN
Set pstoploss at (price+min stop distance) (or maybe just exitshort?)
Endif
But you would need to be able to use a 1M or even 1 sec TF as no good waiting until the end of the 1H TF as volatility may be over by then.
The conditions above would only be read / set at the end of a bar … hence the need for 1 sec TF? PRT Multitimeframe is coming along soon I believe?
Just a few thoughts. I only wish I could code as quick as I think of these daft ideas which probably aren’t even codable?? hahaha
Regards
GraHal
the system already use a trailing stop, what I meant was that it can’t hand shock movements and at the moment it can go long when there is no price-action supporting long positions, therefore I would suggest it to be more trend following. I have not yet tested this so it can be completely wrong.
Sorry GraHal, I think I misunderstood what you said about the stop function. I’ll have a look to see what I can do. Will try to see if I can use any of your suggestions 🙂
I’m thinking that it could be changed to something like this. I have tried to create the same system with much less indicators. Still missing the real robust edge.
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Prevents the system from placing new orders on specified days of the week
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
// indicators
indicator1 = TRIX[9](close)
indicator2 = Average[6](TRIX[9](close))
indicator3 = Average[20]
indicator4 = Average[150]
// Conditions to enter long positions
c1 = (indicator1 CROSSES OVER indicator2)
c2 = (indicator3 > indicator4)
c3 = (indicator1 < -0.01)
IF (c1 AND c2 AND c3 ) AND not daysForbiddenEntry THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to enter short positions
c11 = (indicator1 CROSSES UNDER indicator2)
c12 = (indicator3 < indicator4)
c13 = (indicator1 > 0.01)
IF (c11 AND c12 AND c13 ) AND not daysForbiddenEntry THEN
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Stoploss
SET STOP pLOSS 55
trailingstart = 40 //trailing will start @trailinstart points profit
trailingstep = 10 //trailing step to move the "stoploss"
//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*pipsize THEN
newSL = tradeprice(1)+trailingstep*pipsize
ENDIF
//next moves
IF newSL>0 AND close-newSL>=trailingstep*pipsize THEN
newSL = newSL+trailingstep*pipsize
ENDIF
ENDIF
//manage short positions
IF SHORTONMARKET THEN
//first move (breakeven)
IF newSL=0 AND tradeprice(1)-close>=trailingstart*pipsize THEN
newSL = tradeprice(1)-trailingstep*pipsize
ENDIF
//next moves
IF newSL>0 AND newSL-close>=trailingstep*pipsize THEN
newSL = newSL-trailingstep*pipsize
ENDIF
ENDIF
//stop order to exit the positions
IF newSL>0 THEN
SELL AT newSL STOP
EXITSHORT AT newSL STOP
ENDIF