Shifting back to SL after positive stop sert
- This topic has 4 replies, 3 voices, and was last updated 3 years ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
Similar topics:
Forums › ProRealTime English forum › ProOrder support › Shifting back to SL after positive stop sert
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
IF 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 macd BUY myamountlong PERPOINT AT MARKET endif //=============================================== //To keep positive stop //=============================================== If not onmarket then keepstop=0 endif If longonmarket and keepstop=0 then //and keepstop=0 set stop loss longrisk set target pprofit longrisk*1.1 keepstop=1 // keep positive stop once set endif //=============================================== //End To keep positive stop //=============================================== IF TDclose THEN SELL AT MARKET ENDIF IF 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 macd SELLSHORT myamountshort PERPOINT AT MARKET endif //=============================================== //To keep positive stop //=============================================== If not onmarket then keepstop=0 endif If shortonmarket and keepstop=0 then//and keepstop=0 set stop loss shortrisk set target pprofit shortrisk*1.1 keepstop=1 //// keep positive stop once set endif //=============================================== //End To keep positive stop //=============================================== IF TDclose THEN //myexitshort or EXITSHORT AT MARKET ENDIF endif //set stop to positive If not onmarket then setstop=1 endif //0=off 1=on If not OnMarket then NewSL = 0 Endif If NewSL = 0 and PositionPerf > 0 and setstop Then Pips = tradeprice * PositionPerf If setstop=1 and longonmarket and Pips >= (longrisk/1.8) and ((longrisk/1.8)- (longrisk/3.1))>=5.5 Then//drawdown0 myfactor3=longrisk/3.1 NewSL = tradeprice + myfactor3 setstop=0 endif If setstop=1 and shortonmarket and Pips >= (shortrisk/1.8) and ((shortrisk/1.8)- (shortrisk/3.1))>=5.5 Then//drawdown0 myfactor3=shortrisk/3.1 NewSL = tradeprice - myfactor3 setstop=0 endif If NewSL > 0 Then SELL at NewSL STOP EXITshort at NewSL STOP Endif Endif |
Try moving the last ENDIF to just before line 53.
Roberto,
?
I think you wanted to suggest something else ?
You are right PeterSt, I had to write try moving the last ENDIF to just before line 65.
hmm.. Lolzzz
Lets do that and see
cheers
Find exclusive trading pro-tools on