Stop Loss = MFE less Spread

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #173563 quote
    deletedaccount051022deletedaccount051022
    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
    robertogozzirobertogozzi
    Moderator
    Legend

    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
    deletedaccount051022deletedaccount051022
    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.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

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 deletedaccount051022deletedaccount051022
5 years, 2 months ago.

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