Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 962
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Please help solve the problem.
int n1=.....;
int n2=.....;
M1[i]=iMA(NULL,0,n1,n2,MODE_SMA,PRICE_CLOSE,i);
I display the values of n1 and n2 in the comment, the values are correct, but the mouse is not drawn correctly, not on the entire chart. But if I type in the values of n1 and n2 by hand instead of these variables, everything is drawn as it should be. I do not understand how it is possible when the values of the variables are correct? How can I make the chart be drawn with an offset to the right? Now it is drawn only up to the zero bar, i.e. the current one.
Please help solve the problem.
int n1=.....;
int n2=.....;
M1[i]=iMA(NULL,0,n1,n2,MODE_SMA,PRICE_CLOSE,i);
I display the values of n1 and n2 in the comment, the values are correct, but the mouse is not drawn correctly, not on the entire chart. But if I type in the values of n1 and n2 by hand instead of these variables, everything is drawn as it should be. I do not understand how it is possible when the values of the variables are correct? How can I make the chart be drawn with an offset to the right? Now it is drawn only up to the zero bar, i.e. the current one.
If n1 is not equal to TF value, then I understand why it is not drawn correctly. And shift to the right will make n2 with minus.
I don't understand what TF has to do with it, n1 is the averaging period for calculating the indicator. I have a good idea what to do with it, I'm not sure what to do with it, but I'm not sure what to do with it.
UPD. i put 0 instead of n2 and shift is rendered ok, but n1 is a bit weird :(
That's right! I'm the one who got it wrong, but why wouldn't it work if you're doing it right?!
That's right! I'm the one who's wrong, but why can't it work if you're doing it right?!
Yes, I'm also puzzled by this paradox. If I restart the terminal, the wagon is rendered as it should be, but restarting every time is inconvenient.
UPD I solved the problem by pressing right button and selecting "Refresh" from menu, but if I press compile in the code, the drawing is messed up... But that's a trifle, I'll just refresh :))
I'm also puzzled by this paradox. If I restart the terminal, then the wagon is drawn as it should be, but it's inconvenient to restart every time.
UPD The problem was solved by right-clicking and selecting "Refresh" in the menu, but if I press compile in the code, the wagon is drawn incorrectly... but that's a trifle, I'll just refresh :))
Sorted it out myself, thanks for your input :)
1. An EA opens (based on crossover with MA) multiple (3) market orders at the same price (e.g. BUY at 1.1180).
Before the MA was crossed, the orders were Buy Stop orders.
2. What is this mod_Buy1/2/3 ? - Do you understand the purpose of the above for-cycle?
yesatztek, I apologise for the inaccuracy in the description:
1. Because before the intersection with the MA, these were buy-stop orders and Ur1 Ur2 Ur3 are identified only after the price crosses the MA.
2. and respectively the above mentioned for-cycle searches among all buy orders (since there are 3 more sell-stop orders and they crawl on a different MA at each candlestick)