Fred4X: I would like to know how to show MA cross-over at MA cross level (at the lines)
NOT at the price level (at the candles)..
- 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
Messages Editor - If you put the MAs on the chart, they show you the cross. No code required.
- You can only draw an arrow at a candle or a line connecting two. You can't draw where they crossed (between two candles.) A line connecting bar 2 onward is the best you can do.
- Compute the level where they cross:
F = F2 + T(F1-F2) // \ Assuming MAs moved S = S2 + T(S1-S2) // / linear in time. F2 + Tc(F1-F2) = S2 + Tc(S1-S2) // The cross is when F == S solve for Tc. F2-S2 = t(S1-S2)-t(F1-F2) = t(S1-S2 - F1+F2) Tc = (F2-S2) / (S1-S2 - F1+F2) Fc = Sc = F2 + Tc(F1-F2) = S2 + Tc(S1-S2) // Compute the cross price at time of cross.
Thank you for prompt reply William! ; )
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I would like to know how to show MA cross-over at MA cross level (at the lines) NOT at the price level (at the candles)..
I was looking for some sort of function like " SetIndexPosition(Absolute) " i.e. would display the drawing (e.g. arrow or circle) exactly where the cross happened.
Is there a way to do that?
Any help would be much much appreciated! Thanks! ; )
my current code of that section, not sure if this would be in that section or not..!?