[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 643

 
alsu:
What do you mean by disconnect? If it is simply a loss of connection to the server, then the EA does not stop its work, it just waits for the connection to be restored and a new tick to come. If we mean a restart of the terminal, the Expert Advisor will automatically restore and pick up the parameters with which it was launched last time, so there is no need to save and load anything, everything happens automatically.

So the person is asking how to make the EA "automatically" pick up important variables that may have been lost when it was switched off. In particular, the question was about saving and then reading those variables.

Not every Expert Advisor is able to do that... :)

 
artmedia70:

So the person is asking how to make the EA "automatically" pick up important variables that may have been lost when it was switched off. In particular, the question was about saving and subsequent reading of these variables.

Not every Expert Advisor is able to do it... :)

The question is about saving parameters of the EA which we do not need to manually save - the terminal does everything for us. We haven't talked about internal program variables yet.
 

Hello. There is a function

int LineW()

{

ObjectCreate("LineW"+W, OBJ_HLINE, 0,0,0,0,0);

ObjectSet("LineW"+W, OBJPROP_PRICE1, KOORD);

ObjectSet("LineW"+W, OBJPROP_COLOR, COLOR);

ObjectSet("LineW"+W, OBJPROP_WIDTH, Stil);

ObjectSet("LineW"+W, OBJPROP_BACK, false);

WindowRedraw();

W=W+1;

}

It is located in the Expert Advisor. It draws horizontal lines if a certain condition is met. I copied and pasted this function into the indicator, adjusted parameters, but the indicator does not want to draw lines.

I am doing something wrong or this function does not work in indicators?

 
pipkin.artem:

Hello. There is a function

int LineW()

{

ObjectCreate("LineW"+W, OBJ_HLINE, 0,0,0,0,0);

ObjectSet("LineW"+W, OBJPROP_PRICE1, KOORD);

ObjectSet("LineW"+W, OBJPROP_COLOR, COLOR);

ObjectSet("LineW"+W, OBJPROP_WIDTH, Stil);

ObjectSet("LineW"+W, OBJPROP_BACK, false);

WindowRedraw();

W=W+1;

}

It is located in the Expert Advisor. It draws horizontal lines if a certain condition is met. I copied and pasted this function into the indicator, adjusted parameters, but the indicator does not want to draw lines.

I am doing something wrong or this function does not work in indicators?


You can build any object from an indicator
 
no answer
artmedia70:
In the first instance, ask the person who gave it to you.
 
alsu:
What do you mean by disconnect? If it is just a loss of connection with the server, then the EA does not stop its work, it just waits until the connection is restored and a new tick comes. If you mean restarting the terminal, then the Expert Advisor will automatically load itself and pick up the parameters, with which it was launched last time, so there is no need to save and load anything, everything happens automatically.


The thing is that I'm not very good at MQL programming and my EA is based on Bacyca principles =) A variable is assigned to an open order. The terminal says that I have been re-logged and the value of this variable disappears when the order is opened. I think what should be done if the order is re-logged? If this happens, the terminal should check for the open positions and assign those values to the variables that have been assigned by the robot. As for the EA, it has shown rather good results in the test.

 

Good day to all!

Can you please advise how to make the EA run not on every tick, but between each tick, because sometimes the time between ticks is very long (up to 3 minutes)?

I have a very big time between them (up to 3 minutes). Thanks.

 
FelixFX:

Good day to all!

Can you please advise how to make the EA run not on every tick, but between each tick, because sometimes the time between ticks is very long (up to 3 minutes)?

I have a very big time between them (up to 3 minutes). Thank you.

I need to loop the start.
 
Zhunko:
A looped start is needed.

If you don't mind, here's an example. As far as I understand the data will not be updated until the loop is executed?
 
pipkin.artem:

Hello. There is a function:

It is located in the EA. It draws horizontal lines when a certain condition is met. I copied and pasted this function into the indicator, adjusted parameters, but the indicator does not want to draw lines.

I am doing something wrong or this function does not work in indicators?

Presumably, you don't consider the W parameter in your code, which is a counter so that the object to be drawn (in this case the horizontal line) has a unique name.
Reason: