Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 222
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. I can not understand the for() loop, all the time after the update, because of the offset(iMA(NULL,PERIOD_M1,1,1,MODE_SMA,PRICE_OPEN,i)) The indicator redraws!
Many thanks in advance.
In my opinion, the approach is not logical at all. Why define the day of the week? What difference does it make what day it is, if the condition should say "do not open more than xxx orders today"?
It seems more logical to me to count the orders opened today and specify the corresponding condition.
there is no date of order opening.If you know, please write how to do it)
I do not understand how to make sure that on any given day no more than n-th number of orders are opened during the whole day.
Please help. I can not understand the for() loop, all the time after the update, because of the offset(iMA(NULL,PERIOD_M1,1,1,MODE_SMA,PRICE_OPEN,i)) The indicator redraws!
I thank you in advance.
The MAs have different TFs. You need to sort of fit the higher timeframe into the M1 TF, i.e. count the MAs twice with different numbers of ticks. In this case one and the same value of the older period will be added to different values of the younger one.
If you look through i you get, for example, 10 candles of period D1 and 10 M1. Logically something is wrong....
Another thing, if the indicator is set on M1, it will work without re-brisings most likely
the MAs have different TFs. you have to sort of fit the higher timeframe into the M1 TF, i.e. count the MAs twice with different numbers of ticks.
By going through i you are now taking for example 10 candles of period D1 and 10 M1. Logically something is wrong....
Yes you are right, but my mind is still not enough to figure out how to get M1 to count correctly
Besides, I need to synchronize M1 with a higher timeframe, because 1 bar of M5 will not necessarily correspond to 5 candles of M1, it may be 4 or 1.
Yes you are right, but my mind is still not enough to understand how to make M1 count correctly
Try
time of the i-th bar and put the resulting bar number instead of i.
Dear novikov433!!! Teach you programming, or write you a free Expert Advisor or both!!! In exchange, teach me how loss-making orders are translated into no-loss. You can use a simple example. I give my wife an order (order): buy a bucket of potatoes early in the morning at the market, and by 10 o'clock (fundamental analysis) the price goes up - sell. But sometimes a truckload of potatoes arrives at 10:30 (news). And the price (on the news) instantly goes down and it lasts till the end of the day, or even for the whole week. I place a Stop Loss - if the price falls by 10 rubles, I sell as soon as I can (at the market price). How to change the order, to avoid losses. If this variant is interesting - send us your e-mail.
Try
the time of the i-th bar and put the resulting bar number instead of i.
Have you thought of something like this?
Thank you for your attention )) I am a sucker ... ... at closing I had the condition to close the deal at 22:00 on Friday, without any additional conditions to check the deal type. The deal itself closed a couple of hours earlier. Well, when 22:00 p.m. came, the Expert Advisor started sending orders to close an order that was already closed ... .