1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Welcome back! Thank you for being a part of this Traders Community. Let's discuss and share :)
    Selamat datang kembali! Trimakasih telah menjadi bagian dari Komunitas Trader ini. Mari berdiskusi dan berbagi :)
    Dismiss Notice

help me about trailing stop

Discussion in 'Belajar MQL dari Nol' started by ali.yar, 14 Feb 2020.

  1. ali.yar

    ali.yar Member Credit Hunter

    Equity
    Credit
    Ref Point
    hi guys hope doing well

    i wanna write a kind of logic that :
    int trailingextra = 10;
    if take profit >= trailingextra move stoploss to current price
    please help me write it thank you
     
  2. 9nix6

    9nix6 New Member

    Equity
    Credit
    Ref Point
    You can go through my code or use the logic: https://github.com/9nix6/Median-and...master/Include/AZ-INVEST/SDK/TradeManager.mqh

    The trailing stop is used in the "Run" section of the EA via the function presented below:

    Code:
    tradeManager.Manage(_ticket, tradeManagerState); 
    The EA code is here:
    https://github.com/9nix6/Median-and-Turbo-Renko-indicator-bundle/blob/master/Experts/Renko_EA.mq5
    And the "Run" section is defined here:
    https://github.com/9nix6/Median-and...bundle/blob/master/Experts/Renko_EA_Logic.mqh
     
  3. AutoProfit

    AutoProfit Active Member Credit Hunter

    Equity
    Credit
    Ref Point
    how do we can move SL to current price. this will cause invalid stops (error code 130)
     

Share This Page