3.1) Controlling Bar Opening in your MetaTrader EAs (Expert Advisors). MQL5, MQL4 Coding Techniques

Поделиться
HTML-код
  • Опубликовано: 14 дек 2024

Комментарии • 18

  • @jadjouds
    @jadjouds 4 года назад +5

    Stopped everything as soon as I saw the notification to watch your video :)

  • @evsssaavvaa6843
    @evsssaavvaa6843 3 года назад +2

    Hey Martin,
    Your content is pure gold nuggets!
    I just started my algo trading journey and you basically reading and answering the questions from my head :)
    Hope we will have a chance to work together some day!

  • @harryokonkwo3419
    @harryokonkwo3419 4 года назад +3

    Watched video as soon as the notification popped up.

  • @subarkahsubarkah969
    @subarkahsubarkah969 2 года назад +1

    Thanks Martyn, such an invaluable tip!

  • @PrinceBediHene
    @PrinceBediHene 3 года назад +1

    Amazing Content here. I’m really grateful to you Martyn. I’m really learning a lot. I have a question though. Ive literally setup my system to trade on the DAILY timeframe. My question is, what data do you recommend i use for my backtesting tick data, M1 open price or the daily.

  • @edh9500
    @edh9500 3 года назад +1

    Love the videos.
    Question on the processing of ticks. If you are only processing the open tick for M1 OHLC, and you have your Period() function set to your trading time frame; why not use M1 Open Prices Only. Isn't that is going to be the same tick as the open tick for M1 OHLC?

  • @keithlong5873
    @keithlong5873 4 года назад +1

    Hi, in a multi-currency EA, the method posted in your Github might have some issue. Specifically, in Open price only mode for backtesting. E.g. if Strategy tester is pushing D1 ticks, other currency tick might arrive slower than the driving currency tick, causing the other currency tick not to be recognized by the EA if the EA timeframe is same as the strategy tester tick. Is setting the Strategy tester to push out

    • @TradeLikeAMachine
      @TradeLikeAMachine 4 года назад +2

      Hi Keith. Yes you're right. To get over this issue you need to combine the Multi-Symbol code with the technique I explain in this video ruclips.net/video/dRRY_WIXKRg/видео.html
      You will have to have an array for the lastTickProcessed variable to that each symbol is monitored separately. and a tick from each symbol is managed separately. This is exactly what I do in my EA. However introducing both of these concepts together would have confused people, and so I kept them as separate videos. Hope that helps

    • @qamer88
      @qamer88 3 года назад +1

      @@TradeLikeAMachine I am having exactly same problem. Tried to solve that by the approach you explained in your comment, but no chance for now.Any chance to share a sample code?

  • @muhammadabubakar8533
    @muhammadabubakar8533 3 года назад

    Good information. But how do we code a single bar in mql4 platform

  • @arfa9601
    @arfa9601 2 года назад

    Also, be careful with using limit orders where varying spread plays a significant role. Moreover, watch out for spread divergence/spikes in low activity times of day, specially if your strategy has a vol compression element. Cheers

  • @amaldevasia4143
    @amaldevasia4143 3 года назад

    How open price only mode closes an open position when it hits TP or SL. Will it wait till the next open price to arrive according to time frame even if it has already crossed the SL or TP.

  • @jeffrey5744
    @jeffrey5744 2 года назад

    Hey Martin, Thank you for such an amazing Content!
    I have a question please! should we use "control the Bar opening" just for the backtesting purpose, or it should be implemented in the EA during live trading as well?

    • @jeffrey5744
      @jeffrey5744 2 года назад +1

      OK, after rewatching again , I understand the following:
      Our goal is to unify the behavior of the algo during the back test and the live trading. Because during backtest every tick will be processed, while during live trading the algo will ignore the coming tick till finishing the one which is getting processed.
      So to unify the behavior, we should do the following:
      1- At the back testing end we should use the "open price only" method and that will solve the problem of processing every tick during back testing.
      2- At the live trading end, since there is no "open price only" method to choose as in the tester case, we need to add it by entering this "Coding Techniques", so we force the algo to only process the open tick and not trying to process every tick.
      By doing that we are unifying the behavior of the algo in the tester during the back testing and in the live trading.
      That is my last understanding, any correction is very welcome!😉
      Again thank you so much Martin!

  • @kgothatsobojosi2377
    @kgothatsobojosi2377 2 года назад +1

    I love you men❤️