Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1112

 
Mislaid:

No, 100 charts are enough, but, you have to write the indicator correctly.

Well, yes. You can't open more than 100 charts in Metatrader.

And how to organize the timely loading of history for all symbols and timeframes in the indicator?
The ArrayCopySeries call will do it?

At the start of the indicator the ArrayCopySeries call does not pump the history for new symbols.
Maybe it is not pumped because the market is closed on weekends?
 

Good day! Need some help! When the EA is working the order is closed by a stop and immediately on a new tick there is an opening of a new order on the same bar in the same direction and, as a consequence, the stop is triggered again and this may continue several times. The goal is to open a new order after it has been closed by a stop and only after the next crossing of the short MA with the long MA. If possible, please suggest the code in mql4. Many thanks in advance!

 
Sokolmih:

Good day! Need some help! When the EA is working the order is closed by a stop and a new order is immediately opened on the same bar in the same direction and, as a consequence, the stop is triggered again and this may continue several times. The goal is to open a new order after it has been closed by a stop and only after the next crossing of the short MA with the long MA. If possible, please suggest the code in mql4. Thank you!

If there is no change in the order, it should not trade anymore, and if there is a new crossing, it should not trade.

I will not write the code from scratch - this is for freelancers.

 
RickD:
Well, yes. You cannot open more than 100 charts in Metatrader.

And how to organize the timely downloading of the history for all symbols and timeframes in the indicator?
The ArrayCopySeries call will do it?

At the start of the indicator, the ArrayCopySeries call does not pump the history for new symbols.
Maybe it is not pumped because the market is closed on weekends?

You need a script for weekends.

I work on weekdays. That's why I use the indicator. I give it a list of instruments and it requests quotes for the timeframe, on the chart of which it is located. I don't bother with error handling. After a dozen minutes everything settles down.

I completely forgot. If you need to save the history, a chart for an instrument should always be open.

 
evillive:

The time or price of the crossing should be stored in global variables of the terminal or in a file and the current situation on the chart should be compared with the stored value; if there is no change and the order has been crossed - do not trade again, if there is a new crossing - trade.

I will not write the code from scratch, it should be done by a freelancer.

Thank you

I am not asking for the whole code, but please give some hints/hints. Here's how to identify the next crossover, can you help?

 
Sokolmih:

Thank you

I'm not asking for the whole code of course, but please give me some pointers/suggestions. Here's how to determine the next intersection, can you help?

Yes, in the same way as the previous ones, you have an EA, look in the code.
 
evillive:
Yes exactly the same as the previous ones, you have the EA, look in the code.
Maybe I did not ask the question correctly, look, I identified in the history that the last order closed at stop and now, according to your advice, I have to remember the value of short and long and then at next ticks I have to compare them with current values and if one becomes lower or higher than the other, then I open an order. Do I understand correctly.
 
Sokolmih:
Perhaps, I didn't ask the question correctly. Look, I checked the history and found out that the last order was closed by a stop and now according to your advice I should memorize the values of the short and long and then at next ticks I should compare them with the current values and if one becomes lower or higher than the other, then I open a new order. Do I understand correctly.

You can remember the opening time of the bar where the crossing of two MAs is recorded. The Expert Advisor has memorised the time of crossing and opened an order. This is followed by monitoring the presence of a market order as far as I understand there is only one order in the market.

Once the order is closed, the Expert Advisor compares the time of order closure with the time of crossing. If OrderCloseTime>CrossTime, the trading is prohibited and a new crossing is monitored. If a new crossing is found during this period - remember its time. In this case, OrderCloseTime<CrossTime automatically becomes a new order and a new order is opened.

 
evillive:

You can remember the opening time of the bar where the crossing of two MAs is recorded. The Expert Advisor has memorised the time of crossing and opened an order. This is followed by monitoring the presence of a market order as far as I understand there is only one order in the market.

Once the order is closed, the Expert Advisor compares the time of order closure with the time of crossing. If OrderCloseTime>CrossTime, the trading is prohibited and a new crossing is monitored. If a new crossing is found during this period - remember its time. This automatically becomes OrderCloseTime<CrossTime and a new order is opened.

I got the conditions and now I am trying to figure out how to determine the time of opening the bar where the crossing of two MAs is fixed. Thanks for the tip.
 
Mislaid:

You need a script for weekends.

I work on weekdays. That's why I use the indicator. I give it a list of instruments and it requests quotes for the timeframe, on the chart of which it is located. I don't bother with error handling. After a dozen minutes everything settles down.

I completely forgot. If you need to save the history, the chart for the symbol must be open.

We cannot keep more than 100 charts open. We need 100 pairs in 9 timeframes = 900 charts.

The market is launched. But neither CopyTime, nor ArrayCopySeries calls automatically replenish the history for instruments from MarketWatch.
The charts for the instruments were never opened.
There must be a solution.

For example, AUDCAD. There were no open charts for this symbol. If I manually open the chart AUDCAD H1 and press the buttons, the history will be loaded. It is the same on other timeframes - only in manual mode, it does not want to do it automatically.
Reason: