Trading on trend line breaks in MT4 and MT5: Expert, Indicator and Script Code

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

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

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

    You are a Champion, exactly what I need for an EA I am working on.

  • @gotofree2669
    @gotofree2669 2 года назад +2

    You are amazing that you provide this free content. I WAS WONDERING IF YOU WOULD WRITE AN RSI DIVERGENCE CODE FOR MT4

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

    Dear Orchar Forex, thanks for this video too. Only a very small and not too important comment: #property script_show_inputs is already working in mql4 too.

    • @OrchardForex
      @OrchardForex  4 года назад

      Thank you. I hadn't noticed that one.

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

    Thank you for the great code!!
    This is exactly the code i needed!!!

  • @oratiletamalah4765
    @oratiletamalah4765 4 месяца назад

    Thanks for this video Sir, I would like to ask if we wanted to code so that if an X amount of bars failed to cross the trendline how would I be able to implement that? I apologize if my question isn't clear.

    • @OrchardForex
      @OrchardForex  4 месяца назад

      You would have to loop through that number of bars and compare high/low to the trend value at each bar.

  • @cozzi67
    @cozzi67 Год назад

    do u have a copy of the code, I started typing it out and managed to compile the 1st bit ( albeit with many typo's etc) so would be helpful if we could downlaod the code -thanks in advance

  • @jafxtradinginstitute6395
    @jafxtradinginstitute6395 4 года назад

    1:40 min there about that huge candle at the trendline. Divergence occurs there ?

    • @OrchardForex
      @OrchardForex  4 года назад

      It's only a 1 hour chart and that would have been a weekend price gap.

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

    What should I change, if I want to this exact ea, but to buy exactly when it crosses the line, without the confirmation ?

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

      Look for the first tick with price over the line.

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

      @@OrchardForex Thank you very much !

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

    Grat video, many thanks for your work. I have a problem and maybe you can help me. I tray in part two simulate with dre previous draw line bur diring 3 days I have not been able to see the line durin simulation. What I'm doing wrong? When begin simulation it opens a new window but the line is not there. If need I can send you a video. Many thanks !!

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

      SR lines depend on finding enough zig zag points at the same level. If you are using strategy tester there may not be any older or enough zig zag points. Add the zig zag indicator and see how many points have been drawn

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

      Many thanks for your feedback. !!

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

    Thanks for this video. How did you load the Trend line ( yellow line ) to visual Tester?
    When I try to test the indicator, I do not see my Trend line.

    • @OrchardForex
      @OrchardForex  4 года назад

      Draw the trend line first on a template. See ruclips.net/video/vfBDy52FZyM/видео.html

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

    Hi Orchard thanks for your tutorial it is great work
    I write mqh file in mt4 but it gives me 13 errors, is there any additional file I need to use. thanks again

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

      You need the expert mq4 file and the trendlevel mqh file. If you take time to read the error messages they will tell you if you are missing any files.

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

    Greetings Sir (would you mind creating another tutorial ,explaining how to draw Trendline per every 10-100 bars_)

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

      Do you mean a line to find the trend over a specified number of bars?

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

      @@OrchardForex yes sir.

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

    Hi, thanks for sharing this! However, the trendline that I draw is missing when I run the strategy tester. Do you know any possible reason for this?

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

      Yes. How are you drawing the trend line on the strategy tester?

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

      @@OrchardForex I draw the trendline as usual on my chart and use its name in the input. I also tried drawing it on the chart which is opened by clicking "Open Chart" on the strategy tester.
      A new chart is also opened every time I start running the test and there is no trendline on the chart that is opened when I run it in visual mode.

  • @oratiletamalah4765
    @oratiletamalah4765 Год назад

    Thanks for this amazing video! I want to be able to draw more than one Trend Line and have the Expert check each trend line. What should I do?

    • @OrchardForex
      @OrchardForex  Год назад +1

      Any line you draw on the chart is an object and has a name, you just have to search the objects.

    • @oratiletamalah4765
      @oratiletamalah4765 Год назад

      @@OrchardForex Thank you

    • @oratiletamalah4765
      @oratiletamalah4765 Год назад

      In terms of the indicator since it doesn't use any buffers, how would one use it with the iCustom function?

    • @OrchardForex
      @OrchardForex  Год назад +1

      @@oratiletamalah4765 see 2:17

    • @oratiletamalah4765
      @oratiletamalah4765 Год назад

      @@OrchardForex see when using the iCustom function when interpreting the buffer number for the indicator? Instead of using an actual number for the buffer, I used the statement 'true'. Because the indicator has no buffers. Did I do it right? I got no errors or warnings, and it's working as it should.

  • @RealDealMcCoy11
    @RealDealMcCoy11 4 года назад

    Is there a way to get the max level of a sub window indicator so I can use that number within an indicator to generate signals based on the sub window levels?

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

    excellent
    thanks for sharing

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

    Thanks a lot for your great work!
    I tried to do the same code at MT4, Complier yells at me when declaring the function outside using the scope opertor (ENUM_OFX_TREND_BREAK CTrendLevel::GetBreak(int index))
    It tells me: "ENUM_OFX_TREND_BREAK, identifier already used"
    I don't understand why it seems the declaration of the enum above as a first usage and fail to build here, any idea?

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

    one of my setups I trade is a double bottom on the other side of a trend line break. curious if you already have a tutorial on that which I can combine with this to practice a bit more mql coding? thx in advance and these videos are really good value. instant subscribe haha

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

      by double bottom I mean a W in price making higher lows for example

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

      No I don't have anything about double bottoms or double tops. There are several videos on detecting peaks that might help, check the channel link to see everything we have.

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

      Will do thank you

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

    Thank you again!!! Great coding.... Is there a way to get the expert to rename the trendline rather than stop trading? Thank you again.

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

      Try using ObjectSetString with argument OBJPROP_NAME

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

      @@OrchardForex Thank you. I will try this, this coming week end....

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

      ​@@OrchardForex Thank you. ObjectName has individuality, Is there a way to retrieve objects going by only a part of the ObjectName. For example, indicators may draw objects with ObjectName Low1 for the 1st object, Low2 for the 2nd object and Low3 for the 3rd etc.... Is there a way of identifying only the "Low" part of the ObjectName?
      Thank you.
      Or maybe a way of using ObjectDescription. Because that can be repeated.

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

      @@jglazebrook8930 Just use substring compare

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

    Thank you for the Lesson it's very helpful. Can the code be modified so that when the candles comes from above and touches the Trendline a buy order is executed and candles coming from below a sell is executed.

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

    Fantastic!

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

    Hello, Thank you for these great tutorials and all other ones also, have helped me a lot in my trading, especially this one, I use it as an alert when price breakthrough support/resistance/trendlines, so as a beginner in programming, I've tried to tweak it to alert on multiple lines within the same chart, but failed miserably. Can you please guide me? I'm currently using it in multiple charts to alert on multiple lines.

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

      I found a way, maybe not practical but worked for me, I duplicated the function, and duplicated a separte class file

  • @75hilmar
    @75hilmar 3 года назад

    Thanks a ton!

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

    Sir, Thank's for this Tutorial, I want to trade Higher TrendLine and Lower Trendline. Here we can see that when Price crosses TrendLine Prices is already High, can we make it when Price Breakup LowerTrendline we can Buy with Prev candle Low + some Pips and will be ready for sell at near Higher Trendline or cross.
    if You can Please Make One video Tutorial for that. And Further Please Put the Link Of this Video for Download this Source Code File. Thanks

    • @OrchardForex
      @OrchardForex  4 года назад

      I only ran the demonstration for breaking above but the code already has conditions for breaking below, The code triggers any time the price moves across the trend line in either direction. So far I haven't made this code available for download.

    • @jafxtradinginstitute6395
      @jafxtradinginstitute6395 4 года назад

      When trading trendline you trade after the retest. Enter at a close of the bullish candle that cancel out the sell.. or a break of the pullback structure.

  • @krontexpit
    @krontexpit 4 года назад

    Hi Orchard Forex, I greatly appreciate your videos. I have switched from TradingView to MT4. I have noticed there is a discrepancy between OHLC values and Volume when comparing both platforms. I understand that the tick data comes from different sources. Is there any way to change the live feed source in MT4? Maybe by creating an offline chart with a custom source?

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

      If you can find another source there is no reason why you can't feed that into a history file and use the history file as an offline but you will still have to trade at the broker's price so I don't see the point.

    • @krontexpit
      @krontexpit 4 года назад

      Orchard Forex I see what you are saying, thank you

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

    Hey your link to the trendline break indicator for mt5 brings me to ic markets. .. can you Post the mt5 trendline break indicator as Dropbox or Google drive link.
    Awesome content
    Would be nice
    Best regards ben

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

      There is no link to download the code for this.

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

    Good morning sir , like your works
    Pls can you code me an Ea? I want to code my trading system into an Ea .
    Can you please?

  • @dawoodhassankhan2326
    @dawoodhassankhan2326 4 года назад

    Hey man Nice video ...i have a question ...How we can open Multiple Real Account with Different broker and Also with the same Broker ... And All Trade Just with one click without CopyTrading ... One master Acc Open trade And That trade also open with Different Account With one click ... Please

    • @OrchardForex
      @OrchardForex  4 года назад

      You can add as many accounts from as many brokers as you like to a single MT4 or MT5 (but I don't recommend it) but you can only have one open at a time, Copy trading would be the best option to trade multiple accounts at one time.

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

    where we get this script

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

    Thanks for these videos - amazing work! When I compile the indicator, I get no errors or warnings, but then try to run it in the Strategy Tester as you do, but it fails due to "Invalid pointer access" and points to the line
    ENUM_OFX_TREND_BREAK brk = TrendLevel.GetBreak(1); //Did the closed bar break
    I can't for the life of me spot where I've gone wrong - any help would be appreciated!

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

      Sounds like TrendLevel has not been created as an object yet.

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

      @@OrchardForex Thank you!