Stop trailing distance reduced

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #233151 quote
    winnie37
    Participant
    Veteran

    Hello,

    I use a 20 pips trailing stop. I want it to be reduce as gain is rising. But it stay at 20 pips. How can i fix it ? Thanks

    // Trailing Stop Conditionnel
    IF longonmarket THEN

    IF positionperf > 50 THEN
    SET STOP pTRAILING 8
    endif
    IF positionperf > 30 THEN
    SET STOP pTRAILING 10
    endif
    if positionperf > 20 THEN
    SET STOP pTRAILING 15
    endif
    SET STOP pTRAILING 20
    ENDIF

    IF shortonmarket THEN
    IF positionperf > 50 THEN
    SET STOP pTRAILING 8
    endif
    IF positionperf > 30 THEN
    SET STOP pTRAILING 10
    endif
    if positionperf > 20 THEN
    SET STOP pTRAILING 15
    endif
    SET STOP pTRAILING 20
    ENDIF

    #233155 quote
    GraHal
    Participant
    Master

    You have almost unreachable figures against PositionPerf.

    PositionPerf is a %

    POSITIONPERF

    winnie37 thanked this post
    #233156 quote
    winnie37
    Participant
    Veteran

    how can i fix it then ?

    #233158 quote
    GraHal
    Participant
    Master

    Consider 50 points gain … what is that as a % of instrument price?

    So for DJI at 40000 … 50/40000 = 0.000125.

    So – for DJI at 40,000, you need …

    IF positionperf > 0.000125 THEN
    SET STOP pTRAILING 8
    endif

    The Instruction I linked to above is incorrect when it says PositionPerf is a %.

    PositionPerf is a ratio of Gain to Cost (which it does also says in the link).

    #233159 quote
    GraHal
    Participant
    Master

    Ha did you spot the typo … 50/40000 = 0.00125 (not 0.000125 as above).

    #233160 quote
    winnie37
    Participant
    Veteran

    Thanks. It’s for dax and cac. And if i prefer in pips ? 🙂

    #233162 quote
    GraHal
    Participant
    Master

    If you prefer pips then you can’t use PositionPerf.

    #233163 quote
    GraHal
    Participant
    Master

    You could use …

    IF longonmarket Then
    If Close - TradePrice > 50*pipsize Then
    SET STOP pTRAILING 8
    If Close - TradePrice > 30*pipsize Then
    SET STOP pTRAILING 10
    If .... etc
    endif
    ENDIF
    winnie37 thanked this post
    #233167 quote
    JS
    Participant
    Senior

    Hi,

    Also keep in mind that your code will be read from top to bottom and the last “Set Stop pTrailing” will “override” all previous ones… The effect of your original code is the same as this code:

    If OnMarket then

    Set Stop pTrailing 20

    EndIf

    GraHal thanked this post
    #233178 quote
    XORANDNOT
    Participant
    Senior
    Positionprice * positionperf equals gain or loss in pips. So :
    IF positionperf * positionprice > 30 THEN
    SET STOP pTRAILING 10
    endif
    GraHal thanked this post
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Stop trailing distance reduced


ProOrder support

New Reply
Author
author-avatar
winnie37 @winnie37 Participant
Summary

This topic contains 9 replies,
has 4 voices, and was last updated by XORANDNOT
1 year, 8 months ago.

Topic Details
Forum: ProOrder support
Language: English
Started: 05/28/2024
Status: Active
Attachments: No files
Logo Logo
Loading...