Stop Profit doesnt work
Forums › ProRealTime English forum › ProOrder support › Stop Profit doesnt work
- This topic has 24 replies, 5 voices, and was last updated 10 months ago by PeterSt.
-
-
12/26/2023 at 5:36 PM #225711
Hi, i need a littlew bit help.
Dont know why, but it doesnt work. Stop Profit should be the half of the profit-30 points. Without the SL conditions it works fine, but with….. see the attached picture.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465// Berechnung des aktuellen Profits longvProfitL = high - tradeprice(1)// Berechnung des Stop-Loss-Levels (die Hälfte des aktuellen Profits) longStopLossLevelL = vProfitL * 0.5-30// Berechnung des aktuellen Profits shortvProfitS = tradeprice(1)-low// Berechnung des Stop-Loss-Levels (die Hälfte des aktuellen Profits) shortStopLossLevelS = vProfitS * 0.5-30//// Bedingungen zum Einstieg in Long-PositionenIF NOT LongOnMarket AND close crosses over trailingsl and close > ExponentialAverage[vAverage] THENBUY 1 CONTRACTS AT MARKETENDIFif high-tradeprice(1) > 200 and longonmarket thenset stop profit StopLossLevelLendifIf LongOnMarket AND close < trailingsl THENSELL AT MARKETENDIF// Bedingungen zum Einstieg in Short-PositionenIF not shortonmarket and close crosses under trailingsl and close < ExponentialAverage[vAverage] THENSELLSHORT 1 CONTRACTS AT MARKETENDIFIf tradeprice(1)-low > 200 and shortonmarket thenset stop profit StopLossLevelSendifIf shortonmarket AND close > trailingsl THENEXITSHORT AT MARKETENDIF// Berechnung des aktuellen Profits longvProfitL = high - tradeprice(1)// Berechnung des Stop-Loss-Levels (die Hälfte des aktuellen Profits) longStopLossLevelL = (vProfitL * 0.5)-30// Berechnung des aktuellen Profits shortvProfitS = tradeprice(1)-low// Berechnung des Stop-Loss-Levels (die Hälfte des aktuellen Profits) longStopLossLevelS = (vProfitS * 0.5)-30//// Bedingungen zum Einstieg in Long-PositionenIF NOT LongOnMarket AND close crosses over trailingsl and close > ExponentialAverage[vAverage] THENBUY 1 CONTRACTS AT MARKETENDIFif high-tradeprice(1) > 200 and longonmarket thenset stop profit StopLossLevelLendifIf LongOnMarket AND close < trailingsl THENSELL AT MARKETENDIF// Bedingungen zum Einstieg in Short-PositionenIF not shortonmarket and close crosses under trailingsl and close < ExponentialAverage[vAverage] THENSELLSHORT 1 CONTRACTS AT MARKETENDIFIf tradeprice(1)-low > 200 and shortonmarket thenset stop profit StopLossLevelSendifIf shortonmarket AND close > trailingsl THENEXITSHORT AT MARKETENDIF12/26/2023 at 7:21 PM #225713It mus be set stop trailing, not set stop profit…. now it works
12/26/2023 at 8:25 PM #225716Dont know what to do, Stop Porift dont works for me….
If the trade is 200p in proft the sl should be 80p profit, but i cant find the cerrect way, please help me.
1234567891011// Bedingungen zum Einstieg in Short-PositionenIF not shortonmarket and close crosses under trailingsl and close < ExponentialAverage[vAverage] THENSELLSHORT 1 CONTRACTS AT MARKETENDIFif tradeprice(1)-low > 100 and shortonmarket then//sell at marketSet Stop Profit 80endifIf shortonmarket AND close > trailingsl THENEXITSHORT AT MARKETENDIF12/27/2023 at 10:06 AM #225720Please, post the full code.
12/28/2023 at 12:00 PM #225756Please, post the full code.
THX
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091atr = averagetruerange[pd]if high[prd] >= highest[(prd)*2+1](high) thenph = high[prd]lastpp = phendifif low[prd] <= lowest[(prd)*2+1](low) thenpl = low[prd]lastpp = plendifif lastpp<>lastpp[1] thenif center=0 thencenter = lastppelsecenter = (center * 2 + lastpp) / 3endifendifUp = center - (Factor * averagetruerange[Pd])Dn = center + (Factor * averagetruerange[Pd])Trend = 0if close[1] > TUp[1] thenTuP = max(Up, TUp[1])elseTuP= Upendifif close[1] < TDown[1] thenTDown= min(Dn, TDown[1])elseTDown= Dnendifif close > TDown[1] thentrend = 1elsif close < TUp[1] thentrend = -1elsetrend = Trend[1]endifonce trend=1if Trend = 1 thentrailingsl = TUpr=0g=255elsetrailingsl = TDownr=255g=0endifTP1 = averagetruerange[3]*vTPTP2 = TP1 * 4TP3 =TP1 * 10SL = averagetruerange[3]*vSL// Berechnung des aktuellen Profits longvProfitL = high - tradeprice(1)// Berechnung des Stop-Loss-Levels (die Hälfte des aktuellen Profits) longStopLossLevelL = (vProfitL * 0.5)-30// Berechnung des aktuellen Profits shortvProfitS = tradeprice(1)-low// Berechnung des Stop-Loss-Levels (die Hälfte des aktuellen Profits) longStopLossLevelS = (vProfitS * 0.5)-30//// Bedingungen zum Einstieg in Long-PositionenIF NOT LongOnMarket AND close crosses over trailingsl and close > ExponentialAverage[vAverage] THENBUY 1 CONTRACTS AT MARKETENDIFif high-tradeprice(1) > 100 and longonmarket thenset stop Profit 80endifIf LongOnMarket AND close < trailingsl THENSELL AT MARKETENDIF// Bedingungen zum Einstieg in Short-PositionenIF not shortonmarket and close crosses under trailingsl and close < ExponentialAverage[vAverage] THENSELLSHORT 1 CONTRACTS AT MARKETENDIFIf tradeprice(1)-low > 100 and shortonmarket thenset stop Profit 80endifIf shortonmarket AND close > trailingsl THENEXITSHORT AT MARKETENDIF12/28/2023 at 5:16 PM #225775Some variables are missing, please post the ITF file.
12/29/2023 at 10:15 AM #225795see attached the itf file, thx
01/04/2024 at 11:40 AM #225950try “takeprofit=80”
01/05/2024 at 10:44 AM #225977Is there any chance to get help?
01/05/2024 at 9:51 PM #226012Is there realy noone who can help me? I only need a working example with the stop profit condition, thats all.
Or it is impossible in Version 12? Or should i pay for.
Please, i need only a little bit of help.
01/05/2024 at 10:46 PM #226013Try below to see if the strategy works anyway apart from the snippets including set stop Profit.
It could be there is more wrong with the Strategy and that is why it is not working as you think it should work?
1234567//if high-tradeprice(1) > 100 and longonmarket then//set stop Profit 80//endif//If tradeprice(1)-low > 100 and shortonmarket then//set stop Profit 80//endif1 user thanked author for this post.
01/05/2024 at 11:00 PM #226014Tjx, but the strategy isnt the problem. With and without Stop Profit. There will only one Trade with the Sopt Profit condition, the others will be closed immediately.
01/05/2024 at 11:02 PM #226016forgot one screensshot
01/05/2024 at 11:03 PM #226019Or try this …
1234567if Close-tradeprice(1) > 100 and longonmarket then // Close in place of Highset stop Profit 80endifIf tradeprice(1)-Close > 100 and shortonmarket then // Close in place of Lowset stop Profit 80endifLet us know how you got on.
Anybody else feel free to jump in and help killerplatuze
01/05/2024 at 11:12 PM #226020I get attached now with your MeinHandelssystem1.itf with the commented out lines as I suggested.
Do you get the same?
-
AuthorPosts
Find exclusive trading pro-tools on