STOP LOSS UNDER THE LOW
Forums › ProRealTime English forum › ProOrder support › STOP LOSS UNDER THE LOW
- This topic has 6 replies, 3 voices, and was last updated 7 years ago by
robertogozzi.
-
-
02/24/2018 at 5:09 PM #63819
In a system of this type:
1234567891011C1 = LOW[2] > LOW[1]C2 = LOW[1] > LOWIF C1 AND C2 THENif not longonmarket AND C1 AND C2 thenbuy 5 contract at High stopendifSET TARGET PROFIT 10what is the code to put the stop loss below the minimum?
02/24/2018 at 8:34 PM #6383302/24/2018 at 9:11 PM #63837One ENDIF is missing!
02/26/2018 at 6:45 PM #63999Thanks Roberto and Leo. But the stop does not work as I would like. In fact I want the stop under the minimum of the entrance candle and that it remains fixed there, but now it moves.
I tried to use the stop of the post dochian channel but it does not work. This is my code
3 Time Reversal Donatiello123456789101112131415161718192021222324// Parameters DefinitionDEFPARAM CumulateOrders = False // Posizioni cumulate disattivate// Long ConditionC1 = Low[2] > Low[1]C2 = Low[1] > LowC3 = Open[2] > Close[2]C4 = Open[1] > Close[1]C5 = Open > CloseC6 = Low[1] > CloseIF C1 AND C2 AND C3 AND C4 AND C5 AND C6 THENBUY 1 CONTRACT AT High STOPENDIF//Exit Profit ConditionSET TARGET PROFIT AverageTrueRange[5](close)//Stop Loss ConditionC7 = Low - 0.1*AverageTrueRange[5](close)if longonmarket thensell 1 CONTRACT at c7 stopendifIs there a way to put the stop under the minimum of the enter candle, without it moving with the passing of the bars?
02/26/2018 at 9:56 PM #64026This is your modified code, it should do:
1234567891011121314151617181920212223// Parameters DefinitionDEFPARAM CumulateOrders = False // Posizioni cumulate disattivate// Long ConditionC1 = Low[2] > Low[1]C2 = Low[1] > LowC3 = Open[2] > Close[2]C4 = Open[1] > Close[1]C5 = Open > CloseC6 = Low[1] > CloseIF C1 AND C2 AND C3 AND C4 AND C5 AND C6 AND Not OnMarket THENBUY 1 CONTRACT AT High STOP//Exit Profit Conditionc8 = AverageTrueRange[5](close)SET TARGET PROFIT c8//Stop Loss ConditionC7 = Low - 0.1*c8ENDIFif longonmarket thensell 1 CONTRACT at c7 stopendif02/26/2018 at 11:04 PM #64029if longonmarket then sell 1 CONTRACT at c7 stop endif
This is a good point to ask here.
This type of function never work for me. I don not know why.
If I wish something like this, I have to put
1Set stop ploss (close - (Low - 0.1*c8)/pipsizein order to update my stop loss, or something like
123If close < Low[1] - 0.1*c8 THENSELL AT MARKETENDIF03/01/2018 at 12:57 AM #64168I tested the above code on both Dax and Eur/Usd, h1, and it works finely!
-
AuthorPosts
Find exclusive trading pro-tools on