Clearing in the tester - page 2

 
Aleksandr Slavskii #:

In the tester you will probably not be able to do anything.

You can try to change the way your trawl/stop works in your EA, as I understand it works on the total profit.

I do not remember exactly, but deals closed at clearing differ from those closed by your EA. Look at what it says in OnTradeTransaction().

And then you can adjust your total trawl/stop by amount of trades closed at clearing.

I don't understand what I want to express, but I can't formulate it.


---

Yes, thanks, it all makes sense to me....

I'll write... I'll do it, I'll calculate it, I'll write it. I'll write it up here for real. The question is,the tester doesn't have this data.... And there will be a discrepancy..... ;-)

 
Another question is how to test?
 
Roman Shiredchenko #:
The other question is how do you test?

Test as if there is no clearing. I've had it exactly like that since '14.

 
Roman Shiredchenko #:
How do you test?

So if you adjust for real, there should be no difference with the tester.

Well, for example, 5 trades are opened in the terminal, at the time of clearing, the total profit is 500 rubles . Profit/loss of the trades can be calculated in OnTradeTransaction(), when they are closed during clearing.

After clearing, the total profit of the same trades is zero, but the Expert Advisor should calculate a stop or trawl with +500 rubles and close the trades when the target profit is reached.

In the tester, there is no clearing, so trades are not closed and the Expert Advisor does not record any corrections. Everything should be the same.

 
Aleksandr Slavskii #:

So if you adjust for real, there should be no difference with the tester.

Well, for example, 5 trades are opened in the terminal, at the time of clearing, the total profit is 500 rubles . Profit/loss of the trades can be calculated in OnTradeTransaction(), when they are closed during clearing.

After clearing, the total profit of the same trades is zero, but the Expert Advisor should calculate a stop or trawl with +500 rubles and close the trades when the target profit is reached.

In the tester, there is no clearing, so trades are not closed and the Expert Advisor does not record any corrections. Everything should be the same.

I don't understand anything...

How do I calculate clearing deductions in the Strategy Tester like I do on the real site?

There in the tester everything is in the plus, according to the algorithm....

In the tester - no questions, I'll take into account clearing and deduction of clearing, but in this case the robot logic will change: in the tester it had a drawdown of Equity, when it was going to sell and moving up + 30 points at under the open price +50 points.

even if the position (for example, 12 contracts) is closed by 30 points on a +30 points SL - we would have a +30 points profit on 12 contracts which would be 12 * 1 ruble * 30 points = 360.00 rubles.

------------

Now on real.... Just yesterday - during clearing 700 p was deducted. If I transfer (though you need to watch the opening prices here...) they change after clearing write-off, if I transfer +30 bp to SL and close position in 12 contracts on it, there will ALWAYS be a total loss including write-offs cleared -700,00 RUB. TOTAL: - 340,00 RUB.

---------------------

In reality - no questions, I will take into account these write-offs on clearing and will put in bu + pp to cover these write-offs in the end! But how to simulate this in the tester is unknown.

----------------

For example, yesterday I need -700/12 = 58 points to be in buu. I.e., to go "0" after clearing yesterday - I need to move SL on market contracts - single market pose in 12 contracts at least 58 pips from the opening price in the direction of the position's direction.

 
JRandomTrader #:

Test as if there is no clearing. I've had it exactly like that since '14.

I do so there, but in the tester it's all in the plus, and in the real world with clearing it's all in the minus! :-)
 
Roman Shiredchenko #:

I don't understand...

In reality - no questions, I will take into account these write-offs on clearing and put them in bu + pps to cover these write-offs in the end!

For example, on yesterday's day to put in bu need already -700/12 = 58 pps. I.e., to reach 0 after clearing yesterday - we need to move SL in market contracts - single position in 12 contracts at least 58 points from the opening price in the position direction.

If you implement what you wrote in your EA, you won't have to take anything into account in the tester. In the tester, there are no write-offs and there will be no correction of CU on those write-offs. If there are write-offs in the real account, the Expert Advisor must correct the CU for those write-offs.

That is exactly what we will get.

The only problem is to teach the Expert Advisor to distinguish the closing of trades clearing from the ordinary closing at the stop. But there should be a solution.

 
Roman Shiredchenko #:
Well, I'm doing it that way, but in the tester it's all profitable, but in real trading with clearing it's all negative! :-)

Clearing is not the problem.

But! When working on FORTS you should not rely on position data.

My robots keep track of their trades and remember the original opening price of the position (not after the last clearing), and from it count profits, SL, ...

 
Aleksandr Slavskii #:

If you implement what you wrote in your EA, you won't have to take anything into account in the tester. There are no write-offs in the tester, there will be no CU corrections for those write-offs.

1. If there are write-offs in the real account, the Expert Advisor will correct the CU for those write-offs.

And that will be the result.

2. The only problem is to teach the Expert Advisor to distinguish the closing of trades at clearing,

2.1. from the normal stop loss. But there should be a solution.

Spc,

1. I'll do it - I can share it here...

2. there is no closing of trades at clearing - I know how to account for this (minus) accumulated in the code.

2.1. there when closing on stop - it will be plus! as the stop in BU +

 
JRandomTrader #:

Clearing is not the problem.

But! When working on FORTS you should not rely on position data.

I have robots keeping track of their trades and remembering the original position opening price (not after the last clearing), and from it count profits, SL, ...

interesting....

will have to think about.... indeed the opening price of the position after clearing - "jumps"... :-)

I did not know that...

Reason: