Shifting back to SL after positive stop sert
Forums › ProRealTime English forum › ProOrder support › Shifting back to SL after positive stop sert
- This topic has 4 replies, 3 voices, and was last updated 3 years ago by
Philstrading.
-
-
02/28/2022 at 3:54 PM #189056
Hi
I’ve been having my positive stop shift back to normal SL when it pulls back a bit, esentially when it doesnt meet criteria to shift to positive stop I think…it confused me a bit so I put in code so that is shouldn’t do it, but it continues to do it.
I included code into the SL and TP so tat it wouldn’t be calculated after its been set, but it still continues to shift back to its original stoploss..
I have created a ticket, but am I missing something obvious?
Below is related code, I’ve added code to rule out it shifting only, but it appears to continue… there is no other code relating to the stoploss or new positive stop
Reverting back to SL on pullback123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869IF not onmarket and stoptrade and longcond and mybullish and clong and tradeok and tradestoplong and tradestopatr and bullishmacd4 and myatrnow and ranging THEN // // and mybullishconf removed but retained macdBUY myamountlong PERPOINT AT MARKETendif//===============================================//To keep positive stop//===============================================If not onmarket thenkeepstop=0endifIf longonmarket and keepstop=0 then //and keepstop=0set stop loss longriskset target pprofit longrisk*1.1keepstop=1 // keep positive stop once setendif//===============================================//End To keep positive stop//===============================================IF TDclose THENSELL AT MARKETENDIFIF not onmarket and stoptrade and shortcond and mybearish and cshort and tradeok and tradestopshort and tradestopatr and bearishmacd4 and myatrnow and ranging THEN // and mybearishconf removed but retained macdSELLSHORT myamountshort PERPOINT AT MARKETendif//===============================================//To keep positive stop//===============================================If not onmarket thenkeepstop=0endifIf shortonmarket and keepstop=0 then//and keepstop=0set stop loss shortriskset target pprofit shortrisk*1.1keepstop=1 //// keep positive stop once setendif//===============================================//End To keep positive stop//===============================================IF TDclose THEN //myexitshort orEXITSHORT AT MARKETENDIFendif//set stop to positiveIf not onmarket thensetstop=1endif//0=off 1=onIf not OnMarket thenNewSL = 0EndifIf NewSL = 0 and PositionPerf > 0 and setstop ThenPips = tradeprice * PositionPerfIf setstop=1 and longonmarket and Pips >= (longrisk/1.8) and ((longrisk/1.8)- (longrisk/3.1))>=5.5 Then//drawdown0myfactor3=longrisk/3.1NewSL = tradeprice + myfactor3setstop=0endifIf setstop=1 and shortonmarket and Pips >= (shortrisk/1.8) and ((shortrisk/1.8)- (shortrisk/3.1))>=5.5 Then//drawdown0myfactor3=shortrisk/3.1NewSL = tradeprice - myfactor3setstop=0endifIf NewSL > 0 ThenSELL at NewSL STOPEXITshort at NewSL STOPEndifEndif02/28/2022 at 4:08 PM #189059Try moving the last ENDIF to just before line 53.
02/28/2022 at 4:25 PM #189060Roberto,
?
I think you wanted to suggest something else ?1 user thanked author for this post.
02/28/2022 at 4:54 PM #189066You are right PeterSt, I had to write try moving the last ENDIF to just before line 65.
02/28/2022 at 4:57 PM #189068hmm.. Lolzzz
Lets do that and see
cheers
-
AuthorPosts
Find exclusive trading pro-tools on