A script to close all open orders. - page 10

 
SofTAA писал(а) >>

It is not quite clear from the technical point of view how it would look like. Suppose, even if we save the results and read the previous ones at the next launch and use them to calculate the level without loss, no one is still insured against opening a position by hands, then closing it by hands and not launching the script during breaks. Therefore, the readings will be incorrect.


When implementing Breakeven, we should not care how a position was opened and closed, manual or scripted, simple closing or reclosing (using the script or hands). The important thing is the date we set in our script, from this point onwards (including this date) the Breakeven level should be calculated, in chronological order, for subsequent open and closed positions, up to the current time. If we want to change the date, from which the breakeven level is calculated, we again send this script to the chart, but with a date changed in its parameters.

 
sever29 >>:


В задаче по реализации безубытка, нам должно быть все равно, как открывалась и закрывалась позиция(ии), руками или скриптом, простым закрытием или перезакрытием (с помощью скрипта или руками) Все это должно быть не важно. Важно то какую дату мы внесли в параметры нашего скрипт, с этого момента (включительно с этой даты) уровень безубытка должен расчитываться, в хронологическом порядке, для последующих открытых и закрытых позиций, вплоть до текущего времени.

So you have to take the history somewhere, if you set to calculate the breakeven level since 2000, where should the script get the data from? I can more or less understand if it is not a script but an Expert Advisor that will track from the time of launching until the moment it is unloaded from the terminal.

 
SofTAA писал(а) >>

So you have to take the history somewhere, if you set to calculate the breakeven level since 2000, where should the script get the data from? I can more or less understand if it is not a script, but an Expert Advisor that will track from the time of launching till the moment when it is unloaded from the terminal.

What for with 2000? No, it will read a couple of days at most and take the history of open and closed positions from the tabs "account history" and "trade". I tried to demonstrate it on the screenshot (in the trailer). For example, the date of entering the breakeven level is 2010.03.23 06:25 and it calculates the breakeven level for all open positions chronologically, at the current moment. If this date corresponds to the date of opening of an already closed position, the counting is based on the same algorithm, only with closed and current positions taken into account.
Files:
2.rar  42 kb
 
sever29 >>:

Зачем с 2000? Нет, считывать будет максимум пару тройку дней, а историю открытых и закрытых позиций брать из вкладки - "история счета" и "торговля". Попытался наглядно продемонстрировать на скрине (в прицепе). Например дата отсчета уровня безубытка- 2010.03.23 06:25 и дальше, по хронологии, на текущий момент, считает уровень безубытка для всех открытых поз. Если же эта дата соответствует дате открытия, уже закрытой позиции, счет идет по этому же алгоритму, только уже с учетом закрытой и текущих позиций.

The 2000 was just an example, but the point is that a universal script will not work. You can run through the history, but there is also a limitation there "The size of the history list depends on the current settings of the "Account history" tab of the terminal"(c), but this condition can already be met. In principle it is possible to write, I think we can come back to this question when time will appear a little. Because to attach a line for one order which has just been opened is one thing and here you will have to spend a little time.

 
SofTAA писал(а) >>

The 2000 was just an example, but the point is that a universal script will not work. You can run through the history, but there is also a limitation there "The size of the history list depends on the current settings of the "Account history" tab of the terminal"(c), but this condition can already be met. In principle it is possible to write, I think we can come back to this question when time will appear a little. Because to attach a line for one order which has just been opened is one thing and here I will have to spend some time.


The most important thing is understanding achieved. Do not forget, I will wait.

 
Co
sever29 >>:


Самое главное понимание достигнуто. Не забывайте, буду ждать.

With you there is no forgetting))))))))))))

 
SofTAA писал(а) >>

With you you won't forget))))))))))))


:)))

 

khee khee

 
sever29 >>:

кхе-кхе-кхе

I remember, but I'm busy at the moment.

 
SofTAA писал(а) >>

I remember, but I'm busy at the moment.


>> okay.

Reason: