[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 203

 
Let me try to reword the question. Is there an economical difference in the following two position reversal scenarios? 1) To close SELL with 1 lot of volume with OrderClose function and then open BUY with 1 lot of volume 2) While SELL is open with 1 lot of volume, first open BUY with 2 lots and then close SELL with OrderCloseBy function, which also leaves an open position for BUY with 1 lot of volume. In the sample from the manual one spread will be kept in 2) variant.
 

Dmitriy, just sit down and think yourself, calculate on a piece of paper how much you will pay to open a deal in the first and second case...

As for the textbook, if you don't mind, please send me the text where it is written, we'll look into it... maybe you misunderstood the authors or I'm wrong...

In short, we need to figure it out...

 
Dmirtiy писал(а) >>
Let me try to reword the question. Is there an economic difference in the following two position reversal options? 1) To close SELL position with 1 lot volume with OrderClose function and then open BUY position with 1 lot volume 2) While SELL position is open with 1 lot volume, first open BUY position with 2 lots volume and then close SELL position with OrderCloseBy function, which also leaves 1 lot open BUY position. According to the example in the workbook, one spread will remain in the 2) variant.

There is in fact a saving. The opening time of any position is by no means instantaneous. The price can go away during that time. In your case it makes sense to use this technique.

 
Vinin >> :

There is in fact a saving. The opening time of any position is by no means instantaneous. The price can go away during that time. In your case it makes sense to use this technique.

Victor that's exactly it!!! That's what I thought too, most probably the tutorial wasn't about saving spread... Spread was, is and will be and there's nowhere to go (((

 
RomanS писал(а) >>

Victor Exactly!!! That's what I thought too, most likely the tutorial wasn't about saving the spread... The spread was, is and will be, and there's nowhere to go (((.

Only the price can go the wrong way. >> Paradox.

 

If you mean locked, i.e. a position of two equal volumes, there is more than enough "savings"!

compared to closing separately...

The same is true for a "crooked" lock, the only difference is that the residual from the close will essentially = opening separately.

All this is perfectly visible, if you want to trade rather than ponder over a piece of paper with a pencil... ;)))

 
https://book.mql4.com/ru/trading/orderclose - here is a description of the OrderCloseBy() function. Tried to do the same on the demo - it really does reduce the spread by a lot. But it still does not work on Expert Advisor... I am so confused...
 

Specialists please help with the code. The situation is like this: manually set date and time e.g. (datetime some_time=D'2009.08.27 and some time';) need to calculate the distance between the daily opening levels on the 27th and 26th, so what code should be here.

 

Question for experts on templates:

I change the properties of a chart (colours and so on), save it as a default.tpl template.

Now a new window opens by the template...

And how to make a window of visualization during testing also opened as in a template?

I'm sick of changing colour, grid, separators, etc. in its window after each test.

 
tester.tpl
Reason: