Breakeven or SL to entry code
- This topic has 5 replies, 4 voices, and was last updated 8 years ago by .
Viewing 6 posts - 1 through 6 (of 6 total)
Viewing 6 posts - 1 through 6 (of 6 total)
Similar topics:
Forums › ProRealTime English forum › ProOrder support › Breakeven or SL to entry code
Hi David,
Yes you can but the problem is that you probably stop very very often because you have generally à retracement before the impulsion in the good direction.
See on Google the concept of maximum adverse excursion
Have a nice day
Zilliq (in holidays)
Hi David, yes it’s possible with PROBACKTEST specific instructions.
Here is a complete example on how to achieve your breakeven functionnality:
If current buy order is in gain of 30 points, order will be closed at entry price + 5 points.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
defparam cumulateorders = false c1 = close>close[1] if c1 then BUY 1 LOT AT MARKET SET STOP PLOSS 50 endif IF NOT ONMARKET THEN newSL=0 ENDIF IF LONGONMARKET AND close-tradeprice(1)>=30*pipsize THEN newSL = tradeprice(1)+5*pipsize ENDIF IF newSL>0 THEN SELL AT newSL STOP ENDIF |
Hi Nicolas, is it possible to bring the SL to BE + 5 but keep the trade going and not exit it at that point?
Would it be something like this then:
1 2 |
<span class="token comment" spellcheck="true">// Stops and targets</span> <span class="token keyword">SET STOP</span> <span class="token keyword">PLOSS</span> <span class="token number">50</span> |
1 2 3 4 5 6 7 8 9 10 |
newSL = 0 IF LONGONMARKET AND close-tradeprice(1)>=30*pipsize THEN newSL = tradeprice(1)+5*pipsize ENDIF IF newSL>0 THEN <span class="token keyword">SET STOP</span> <span class="token keyword">PLOSS</span> <span class="token number">newSL </span></code><code class="language-prorealtime">ENDIF |
Tx
Steve
Hi Nicholas,
Three question on the above:
Thanks
Hi David, didn’t see the Gunnernic reply before, so here is the answers for your 3 questions:
1/ Gunnernic’ code will not work because PLOSS needs point information and not price one
2/ Once this conditional statement is true one time, newSL will take its value. Since we do not use “else”, newSL will keep its value until a new one will be affected to it.
3/ (1) is the previous number of the order we want to look at
Find exclusive trading pro-tools on