Forum on trading, automated trading systems and testing trading strategies
When you post code please use the CODE button (Alt-S)!
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum (2019.05.06)
Messages Editor -
Perhaps you should read the manual, especially the examples.
How To Ask Questions The Smart Way. (2004
How To Interpret Answers.
RTFM and STFW: How To Tell You've Seriously Screwed Up.They all (including iCustom) return a handle (an int). You get that in OnInit. In OnTick/OnCalculate (after the indicator has updated its buffers), you use the handle, shift and count to get the data.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 (2020.03.08)
How to start with MQL5 - MetaTrader 5 - General - MQL5 programming forum - Page 7 #61 (2020.07.05)
How to call indicators in MQL5 - MQL5 Articles (12 March 2010 - Shawn Gaskill: But I still do not understand how code the Hull Moving Average Crossover to do the following :Yes you do,
(myHMA10[0]>myHMA100[0]) && (myHMA10[1]<myHMA100[1])
double aPrev = …, aCurr = …, bPrev = …, bCurr = …; bool wasUp = aPrev > bPrev, isUp = aCurr > bCurr, isCross = isUp != wasUp;
For a new bar test, Bars is unreliable (a refresh/reconnect can change number of bars on chart), volume is unreliable (miss ticks), Price is unreliable (duplicate prices and The == operand. - MQL4 programming forum.) Always use time.
New candle - MQL4 programming forum #3 (2014.04.04)I disagree with making a new bar function, because it can only be called once per tick. A variable can be tested multiple times.
Running EA once at the start of each bar - MQL4 programming forum (2011.05.06)
You first have to fix your main mistake: you create SEVERAL indicator handles every tick. This is the BIGGEST MISTAKE !!! In MQL5, the indicator handle is created once - in OnInit, and the indicator is accessed via CopyBuffer.
Example: An example of working with iCustom
- 2020.09.06
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Coders,
I am new to coding ( only 4 months of experience)
I have read the Expert Advisor Programming
for MetaTrader 5 by Andrew Young
But I still do not understand how code the Hull Moving Average Crossover to do the following :
When the fast hull moving average crosses above the slow hull moving average, look for buy entries. (Both HMA should be green)
When the fast hull moving average crosses below the slow hull moving average, look for sell entries. (Both HMA should be red)
I have seen many examples of how to code a regular Moving Average Crossover but not
Hull Moving Average Crossover
Could someone help?
See my coding below: