Stop Loss = MFE less Spread

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #173563 quote
    deletedaccount051022
    Participant
    New

    Hi,

    Am analyzing the MGE gap for some of the strategies I run Am trying to tweak some code to set the Stop Loss to equal MFE less N points, to avoid sudden market reversals but I can’t seem to get it to trigger.

    Can someone please advise how this should be?

    if longonmarket then
    mfe = highest[max(1,barindex-tradeindex)](high)
    endif
    StopLossMFE = MFE - 25

    Thanks very much

    @AlgoHunter1 thanked this post
    #173569 quote
    robertogozzi
    Moderator
    Master

    First, use 25 * PipSize, instead of 25. It will affect results when price-to-pip ratio is different from 1:1.

    Try using this as line 2:

    mfe = max(mfe,highest[max(1,barindex-tradeindex)](high))

     
    and make sure your Stop Loss is not negative.

    #173590 quote
    deletedaccount051022
    Participant
    New

    Thank you Sir, very much appreciated.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Stop Loss = MFE less Spread


ProOrder: Automated Strategies & Backtesting

New Reply
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by deletedaccount051022
4 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/13/2021
Status: Active
Attachments: No files
Logo Logo
Loading...