Strategy based on the "ZigZag" indicator - "Last ZZ50" - page 4

 
Vitaly Muzichenko:

If the centre of the beam is broken, the beam is considered spent

If you want to avoid problems after restarting, you should save points of the last ray in a global variable of the terminal and work with them.


Then I think the following statement will be correct: if there is such a picture when putting it on a chart

Figure 3 and 4

and there is no pending order, we do nothing and wait until the situation changes to the following one ?

Figure 1 and 2

?

 
Vladimir Karputov:

Then I think the following statement will be correct: if there is such a picture when we put it on the chart

and there is no pending order - do nothing and wait until the situation changes to this one:

?

The upper picture shows 1 ray is working but 0 is not working so we place a pending order on it. If the pending order was placed before the terminal was closed, it should be modified to the centre of the ray if the ray is redrawn while the terminal is closed

 
Vitaly Muzichenko:

In the upper picture 1 ray is worked out, but 0 ray is not worked out, so we place a pending order on it. If it was placed before the terminal was closed, then modify it to the centre of the ray, if the ray was redrawn while the terminal was closed


I do not understand anything. Who "redrawn"? What "ray"? Please operate with the name of the segments "AB", "BC".

If we see the situation as on fig. 3 and fig. 4 and there are no pending orders - it means we do nothing.

 

Told by


 
Vitaly Muzichenko:

Told by


Can't watch the video yet (temporarily sitting on Edge internet). For now, question two: how best to keep information about the existence of pending orders on the "AB" and "AC" segments.


"Pros."Cons".
Saving in a global variablethe information will be saved if the terminal is restarteda global variable stores information in "double " - it means that the ticket number of a pending order cannot be saved correctly

global variables are not moved to the virtual hosting built into the terminal

Saving into filethe information is saved in case of terminal restart

the file is transferred to the virtual hosting built into the terminal

you can write a ticket to a file - it will be written and read correctly

 
Vladimir Karputov:

Can't watch the video yet (I'm temporarily on Edge internet). For now, question two: how best to keep information about the existence of pending orders on the "AB" and "AC" segments.


"Pros."Cons".
Saving in a global variablethe information will be saved if the terminal is restarteda global variable stores information in "double " - it means that the ticket number of a pending order cannot be saved correctly

global variables are not moved to the virtual hosting built into the terminal

Saving into fileinformation is saved in case of terminal restart

the file is transferred to the virtual hosting built into the terminal

you can write a ticket to a file - it will be written and read correctly

In my opinion

Savingtoa global variable of the terminal

 
Vitaly Muzichenko:

In my opinion

Saving toa global variable


It is possible to correctly save the price into a global variable (i.e. data type double). But it's very dangerous: you can make a mistake with rounding, the user can modify the order (intentionally or unintentionally).

But saving a ticket (ulong type) is a more secure method - even if modified, the ticket remains the same (of course excluding rollovers and clearing (although in the case of clearing I'm not 100% sure)).

 
Vladimir Karputov:

Can't watch the video yet (I'm temporarily on Edge internet). For now, question two: how best to keep information about the existence of pending orders on the "AB" and "AC" segments.


"Pros."Cons".
Saving in a global variablethe information will be saved if the terminal is restarteda global variable stores information in "double " - it means that the ticket number of a pending order cannot be saved correctly

global variables are not moved to the virtual hosting built into the terminal

Saving into fileinformation is saved in case of terminal restart

the file is transferred to the terminal built-in virtual hosting

you can write a ticket to a file - it will be written and read correctly

Also, global variables are lost if terminal or computer crashes - it happens...
 
Aleksey Vyazmikin:

Global variables are also lost if terminal or computer crashes - which can happen...

Forcibly writes the contents of all global variables to disk.

voidGlobalVariablesFlush();

Документация по MQL5: Глобальные переменные терминала / GlobalVariablesFlush
Документация по MQL5: Глобальные переменные терминала / GlobalVariablesFlush
  • www.mql5.com
Глобальные переменные терминала / GlobalVariablesFlush - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Vitaly Muzichenko:

Forcibly writes the contents of all global variables to disk.

voidGlobalVariablesFlush();

Thanks - didn't know about this function!
Reason: