You are really the best! I have been trying this for 6 months with no success... Thank You!
@MQLwithBrian Жыл бұрын
This is the closest information I found for my recent problem. Something that will find multiple values in the past with the same conditions but different index. Thank you! 🙏
@OrchardForex Жыл бұрын
Glad it was helpful!
@hamzavictor23853 жыл бұрын
It is amazing how you solve such difficult problems to a novice in a simplistic and stylish manner. Thank you, I am learning so much from you.
thank you. was missing that final ) on the ObjectCreate for both upper and lower and this was helpful
@jafxtradinginstitute63952 жыл бұрын
@@TheJoshuamcgowan can u connect via telegram ?
@jafxtradinginstitute63952 жыл бұрын
@@AmeerGill are you on telegram?
@jafxtradinginstitute63952 жыл бұрын
I need a coder to network with so we can optimize some indicators. I have 85% winrate strategy using 6 indicators.
@TheJoshuamcgowan3 жыл бұрын
once i finish up my primary work projects im joining your private group. combo of teaching, programming, and trading skills is unique for sure
@TheJoshuamcgowan3 жыл бұрын
nvm. closed to new members haha. makes sense. the world should be beating down a path to your door. thank you for all you do to help educate others. +1
@tamodolo Жыл бұрын
Thank you very much for this!
@olaniyikehindemary45022 жыл бұрын
Thanks so much for all your videos Everyone on of them is the best
@OrchardForex2 жыл бұрын
Glad you like them!
@productvisibilitytvshoppin1107 Жыл бұрын
Thank you, this is great!!
@germanslobo2 жыл бұрын
Thanks Richard for your education.
@johnskinner31453 жыл бұрын
Another piece of code added to my toolbox, thanks.
@mathewz74342 жыл бұрын
hello , how about finding equal peaks like double top
@samsam-dx9xq2 ай бұрын
Thank you so much
@pulsemuziq2 жыл бұрын
Interesting video. So how does one create an ea or indicator using zig zag to find out if the previous candle broke and closed below or above the previous zig zag high or low point?
@OrchardForex2 жыл бұрын
zig zag is a repainting indicator. You have to remember the previous value in code.
@catherinefabian21713 жыл бұрын
Amazing 🥰 Thank you.
@IntegralDeLinha3 жыл бұрын
Thanks!! That was useful!
@OrchardForex3 жыл бұрын
Glad to hear it!
@anupmistry1236 ай бұрын
Thanks mate very good video and coding.
@OrchardForex6 ай бұрын
Thank you
@forester1 Жыл бұрын
I m new big fan of you sir ❤❤❤❤
@mcnyrocher1624 Жыл бұрын
waoh ! Thank you @OrchardForex for that. Please how to add into the code a function to draw a trendline on specific pattern like if its detects a consecutive tripple bullish or bearish bars, robot has to draw a horizontal short trend line on their highest prices or on their lowest prices ?
@mugishajean79233 жыл бұрын
Thank you so much!
@OrchardForex3 жыл бұрын
Glad it helped!
@thanhnguyen82572 жыл бұрын
thank you, sir 😁
@Ohyeahtimesanillusion Жыл бұрын
Thank you so much Richard for sharing this technique. I was stuck on how to handle negative bars and you pulled me out of it. I am now trying to modify the code, so that it waits 5 bars, before repainting. Tried to wrap some part of code around (if (prev_calculated == 0 ) .... else if checknewbar() ...... No luck so far...Not sure how other platforms manage to wait 5 bars in reality when a negative offset/look ahead shoulder is specified. I'm back to solving the problem :)
@OrchardForex Жыл бұрын
Just start the calculations 5 bars back and check at every new bar
@MasterCzen10 ай бұрын
Hello. Can you show me how to make a counter of open and closed positions so that the ADVISER opens only one position to buy or sell during this day?
@molefanekennymphahlele13672 жыл бұрын
Excellent video, thank you very much. Is it possible to do example of programming an alert indicator for specific time frame when the chart e.g create a low followed by high low then continues to form higher high, pulls back to retest the high low. The program must sound when market retest the high low or send an email. Meaning on a downtrend the chart will form a high then form a higher low followed by lower low, when chart retest higher low the program should sound or send an email
@IanKayCey2 жыл бұрын
Amazing!
@OrchardForex2 жыл бұрын
Thanks!
@forester1 Жыл бұрын
greate... works almost correct
@aslambahi9582Ай бұрын
where is the complete code to download
@rajisodiq2333 Жыл бұрын
Thanks for this Mr Orchard. Please, how are we going to create High1, High2, Low1, and Low2 in order to be able to use this function for buy or sell entry? For instance, say, if H2 > H1 (BuyEntry). In this case, H1 is the Peak1 and High2 os the Peak 2. Does everything in the findpeak functions = H1/H2/L1/L2 ? I would be more than happy of I get a solution to ghis questions. Thanks for the training once again.
@OrchardForex Жыл бұрын
I'm not sure what is being asked. The functions find H1 and H2, so if you want to trade based on relative values then just compare them.
@rajisodiq2333 Жыл бұрын
Sir, I meant; how will I say if(Peak2 > Peak1) ? What would be my Peak1
@rajisodiq2333 Жыл бұрын
@@OrchardForex I've rematch the video and gotten what you mean sir. I've watched the video more than going to 10 times though
@rajisodiq2333 Жыл бұрын
@@OrchardForex Do you have any free group or community for your students sir, I would like to join pls?
@rajisodiq2333 Жыл бұрын
@@OrchardForex I tried to compare Bar1 and Bar2 but it doesn't work when I tested it. Pls what am I doing wrong sir?
@ronaldnkhoma82673 жыл бұрын
Could you kindly share the link to the code of the MQL Code?
@martinriri41322 жыл бұрын
hello Richard. i've been a long time follower of your classes and pointers and this was an eye opener. i however have a question on how to use the static double to save the high function (or any other coding reference that you may have), of the peak bars to be used as references for trade entries. like say a peak candle in the 30 minute timeframe to be a reference point of entry in a reference entry point for a lower timeframe.
@OrchardForex2 жыл бұрын
The functions allow you to specify the TF so just specify the M30. If you have a peak in M30 then it must also be a peak in any lower TF.
@HanhTran-wl8twАй бұрын
I testing MT4 is not appear it. Pls help me!
@saeidsaati40212 жыл бұрын
Thank you so much, great video, can you please make a video about creating a semi-log scale for Y axis via MQL, is it possible to do that in metatrader?
@MAkhaneditx Жыл бұрын
How we identify the break of structure on impulse plzz make a code in mt5
@KamiaKavi Жыл бұрын
Thanks for this amazing tutorial! Why is it currentBar-count and not currentBar-count+1? currentBar+1 takes currentBar one bar leftwards (so, if the index of currentBar is 10, it will be 11) and currentBar-count takes currentBar five bars rightwards (so, if currentBar is 10, it will be 10-5 = 5), so I think in this way the currentBar-count is one bar a head of currnetBar+1. Where am I missing the point?
@OrchardForex Жыл бұрын
The function with your example is looking for a bar with 5 (say lower) to left and right. That means bars 5-9 must be lower and also bars 11-15. So start bar is 10-5 for a search distance of 11
@yoenkurniadi47019 ай бұрын
Hello Sir, how to get highest and lowest price after trade begin / open order? Thanks..
@elijahchauke25223 жыл бұрын
Excellent work, would you please show us how to write a code or an expert advisor that draw fib level
@elijahchauke25223 жыл бұрын
Showing us when price is in uptrend and when is in down trend
@SathishKumar-cg8er Жыл бұрын
Will u b able to extend this code to see if the price crosses these lines..
@OrchardForex Жыл бұрын
I don't plan to do that.
@nhtr873 жыл бұрын
Thank' you
@OrchardForex3 жыл бұрын
Welcome 😊
@anubhavmeena30649 ай бұрын
Instead of fixing the bars to look for to 5 can you keep it variable/dynamic (how humans do) to get accurate highs and lows? This will help in correctly identifying break of structure and change of trend. Fixing the bars often leads to fake break of structures. I want to avoid that.
@jglazebrook89302 жыл бұрын
Thank you very much. Yet again works fantastically. One question would be. I was drawing the D1 Trendlines with the script, and when changing to the 5M TF, the trendline remains on the start of the day instead of being on the actual low that occurred during that day.... Is there an easy fix to this? And a big thank you again for the videos, very easy to understand.
@OrchardForex2 жыл бұрын
This is a script. It won't run again automatically when you change timeframe.
@jglazebrook89302 жыл бұрын
@@OrchardForex Yes true, I missed the point that I converted it into an indicator, and hence my question above.
@JsontheBarber2 жыл бұрын
For some reason I'm getting these errors for lines 20 and 29 'ObjectDelete' - no one of the overloads can be applied to the function call could be one of 2 function(s) built-in; bool ObjectDelete(long,const string) built-in; bool ObjectDelete(const string)
@OrchardForex2 жыл бұрын
That's exactly the format I have in the original code. You have mistyped something.
@JsontheBarber2 жыл бұрын
@@OrchardForex I don't see any typos. This is exactly what is there... Line 20: ObjectDelete(0, "upper", OBJ_TREND, 0, iTime(Symbol(), Period(), bar2), iHigh(Symbol(), Period(), bar2), iTime(Symbol(), Period(), bar1), iHigh(Symbol(), Period(), bar1)); Line 29: ObjectDelete(0, "lower", OBJ_TREND, 0, iTime(Symbol(), Period(), bar2), iLow(Symbol(), Period(), bar2), iTime(Symbol(), Period(), bar1), iLow(Symbol(), Period(), bar1));
@OrchardForex2 жыл бұрын
@@JsontheBarber That code is from the ObjectCreate function
@JsontheBarber2 жыл бұрын
@@OrchardForex thank you! I don't know how I over looked that for 2 hours straight. .. (probably just looking too hard)
@SathishKumar-cg8er Жыл бұрын
Nice code as usual.. but if u can extend the code to find if price crosses the line from above & from below, we will b able to use it to automate price cross strategies…
@OrchardForex Жыл бұрын
This shows how to draw the line, after that all you have to do is check for price crossing.
@pipwhisperer59523 жыл бұрын
Please help sir with finding previous high or low only
@ChargeUPFinancial3 жыл бұрын
Dear great Mr.Ochard Please make multiple videos on how to make all the pattern in codes Like head & shoulders Widgets ( Raising & falling ) All the technical patterns please Thanks in advance MQL King
@OrchardForex3 жыл бұрын
I'll see what I can do
@HimasRafeek3 жыл бұрын
Can you please teach how to make a web socket connection from mql4 to a php server so it can send and recieve data?
@shahinsinv3 жыл бұрын
Thanks A Lot, I am awaiting this type of code. Now can we use this code for Auto Trading .
@OrchardForex3 жыл бұрын
Yes you can. That's why I coded it as a function.
@shahinsinv3 жыл бұрын
@@OrchardForex Sir Thanks A Lot , I have made a indicator , which projection of new bar from M15 to Weekly high low , and make it free for MQL5 Community , you can convert it to expeert . if you permit me i will send you coode. Thanks .
@klangfarbeblau2 жыл бұрын
Gosh tell me someone where this music is from before I get totally crazy :) I do not get it
@fcsc63813 жыл бұрын
Can we identify the divergent using the awesome oscillator with code?
@OrchardForex3 жыл бұрын
Sure, why not?
@fcsc63813 жыл бұрын
@@OrchardForex can you share some tutorial example ? 🙏🙏
@forester1 Жыл бұрын
❤❤❤
@chrischannel32502 жыл бұрын
What if peaks and lows are not based on iHighest, iLowest functions, but on a price shift? Meaning, if for a candle number 15 the price moves lower for 40 pips on both sides of the chart, then we consider High[15] as a swing Peak.
@OrchardForex2 жыл бұрын
Then that is not what this video is about.
@HartmutGoetze Жыл бұрын
🙏❤
@OrchardForex Жыл бұрын
Thank you
@rexstephen80542 жыл бұрын
Sir please how can o turn it into an indicator
@OrchardForex2 жыл бұрын
This just gives values. You need to know what you want to do with them before they can be used in an indicator.
@radihadzhiev66303 жыл бұрын
Hello, I am writing my own version of this but in the form of an indicator. When filling the line buffer I keep getting array out of bounds. I am resizing the array to be the size of rates_total + 1 on each on calculate call but I am still getting the error. Is it possible to do a tutorial on how to create an indicator when using the coppybuffer function is not applicable?
@OrchardForex3 жыл бұрын
Have you tried just printing the index value you are using when you get array out of bounds?
@wamashudunetsianda9743 жыл бұрын
Can you make a video of an EA which place order only once per candle
@OrchardForex3 жыл бұрын
Does this help kzbin.info/www/bejne/f6Gac3WGmp2graM
@wamashudunetsianda9743 жыл бұрын
@@OrchardForex it doesn't help, if you can please make a simple EA which can trade every candles but the moment it's either buy or sell it stops trading until new candle appears.
@ggeyy1233 жыл бұрын
Hi Sir, I have complied the script, it has error stating the FindNextPeak is not defined. Pls advise. Thank you.
@OrchardForex3 жыл бұрын
I can only assume that you have a typing error somewhere in the FindNextPeak function name.
@franciscojunior68413 жыл бұрын
Nice...
@OrchardForex3 жыл бұрын
Thanks
@lungpung123 Жыл бұрын
owsem😇
@OrchardForex Жыл бұрын
Thank you
@brightonviews48263 жыл бұрын
how can one parse this into an mql4 EA? i'm getting errors.
@OrchardForex3 жыл бұрын
The same functions will work in EA, Indicator and Script.
@brightonviews48263 жыл бұрын
@@OrchardForex it worked perfectly, thank you.
@mixai73 жыл бұрын
Can copy to mql4?
@OrchardForex3 жыл бұрын
Yes, the same code works for both MQL4 and MQL5
@sairam-pn1lu3 жыл бұрын
Thanks a lot sir, please can you post RSI divergence video
@HanhTran-wl8twАй бұрын
me too, any share here pls!
@shaileshsaxena3 жыл бұрын
Excellent lesson. Thank you once again. I am having problem with OrderSelect() function returning error 0 and leading my EA to believe that there is no open order opened by it. This happens mainly when I have another instance of this EA running on a different pair. I use different magic numbers for each instance. Please make a lesson on how to solve this. Thank you.
@OrchardForex3 жыл бұрын
OrderSelect returns a boolean indicating select was successful or not. It has no filters to select by symbol or magic. It appears you may be using OrderSelect incorrectly.
@OSWALD5693 жыл бұрын
Not good. He finally tests something that is good. But he never mentioned and shown the time of the second point of the line.
@OrchardForex3 жыл бұрын
Sorry you don't like my content. Everything in the functions is shown in the video. What you do with it is up to you
@NikitaSerditov3 жыл бұрын
Why do you need to rewrite Zigzag indicator?
@anubhavmeena30649 ай бұрын
0:00
@autosassfx19343 жыл бұрын
I found this interesting and I'm backtracking it in my EA. can you please write an array function to include the last 10 upper and lower points. Thank you
@HansenKay-q1h4 ай бұрын
Perez Thomas White Helen Davis John
@growmybusinessonline571111 ай бұрын
Can you write an indicator for me in MQL5 if i give you the logic?
@makeit7072 жыл бұрын
I have troubles adding this to my EA! Can anyone assist me? I am new to code so this is kind of a problem for me… @orchard forex do you do small jobs i don’t have much but can pay something
@OrchardForex2 жыл бұрын
This script calls functions to find high and low points. You can just copy the function into your EA to do the same there but how you use the function depends on what your EA plans to do. The lines the script draws are really just for display.
@makeit7072 жыл бұрын
@@OrchardForex how do i use an And or a Or when adding it to buy conditions
@OrchardForex2 жыл бұрын
@@makeit707 I'm not sure what you are asking. This function just finds high and low points. You would need to have a way of using that in your expert. For example if h1 is the most recent high value from the function and h2 is the high before that, and you have similar l1 and l2 for low points, you might want to buy if h1 is higher than h2 and l1 is higher than l2. A traditional higher highs and higher lows. In that cast the and coudition would be if ( (h1>h2) && (l1>l2) ). For an or condition you still need to decide what you are testing then use || instead of &&
@makeit7072 жыл бұрын
@@OrchardForex what i am aiming for is if current candle is higher than higher point and candle(1) is a bear OR candle(2) is a bear than buy, thats what i am battling with the OR
@arthurmcalister14542 жыл бұрын
@@makeit707 So you use the function to get the recent high point, say you put that in double recentHigh. Then you have current price in a variable like double price. And for candles 1 and 2 you have open and close prices like open1, open2, close1, close2. A bear candle is where close