Avalanche - page 116

 
khorosh >>:


Локирование с наращиванием лота используется?

semblance of

 
khorosh писал(а) >>


20-40p, messaged me
 
goldtrader писал(а) >>
Yuri, out of respect for the great work you've done, I'll say that locs don't give any advantage here. I immediately converted your algorithm (not Avalanche) to a net position and got a very close result. I think it (lack of advantages in lots) should be obvious: you save spread and margin. In addition, it saves resources during testing/optimization, because it reduces the loop of open positions. I compared: passes of the net variant are 3 times faster than those of the trailing version. The results differ by 1-3% in favor of the net, which is to be expected in theory. I recommend you to change your code to net if you plan to use it in trading.
.
In your code netting is performed as soon as 2 differently directed positions are opened, in mine it is performed after the aggregate position is in the profit zone.
The rest is trailing. I am not sure if my variant results in more losses on margin and spread - I have not got to such subtleties yet. I'll trust you for now, but I'll try to do as you did and compare.
 
goldtrader писал(а) >>


20-40p, messaged me


Thank you.
 
khorosh писал(а) >>
...The rest is trailing...
I wondered how you trailed the whole "code" of orders :)
I tried to at least imagine it and something even started to come out, but very confusing and complicated :)
 
khorosh писал(а) >>
You netting immediately after 2 differently directed positions appear, but in my case it happens after the aggregate position enters the profit zone.
The balance is trailing. I am not sure if my variant results in more losses on margin and spread - I have not got to such subtleties yet. I'll trust you for now, but I'll try to do as you did and compare.


The trade result (excluding swaps) will be equivalent if
1. your closing also takes place via OrderCloseBy and
2. Your brokerage company does not withhold margin on locked positions (very rare).
Saving resources (fewer orders in the market) when netting is not an option.

 
khorosh писал(а) >>
If in my variant there will be more losses on margin and spread, I'm not so sure, I haven't reached such subtleties yet.


When you check it, if you make absolutely identical version (it didn't work for me),

PapaYozh 29.03.2010 12:30
SergNF wrote(a) >>

My humblest request :)
Please write which "aggregate order" I would need to open instead of . any, starting from the second
2010.03.22 00:38 buy 0.01 1.35339
2010.03.22 08:01 sell 0.02 1.35026
2010.03.23 00:06 buy 0.03 1.35643
2010.03.23 08:37 sell 0.09 1.35026
After your reply, I will make sure to follow up all positions' history.
'
The aim of the Holivar has never been the truth! And I just want to understand . 'pro netting' for these positions. ;)


What is there to understand?
2010.03.22 00:38 buy 0.01
2010.03.22 08:01 sell 0.02 = Close 0.01 buy, Open 0.01 sell
2010.03.23 00:06 buy 0.03 = Close 0.01 sell, Open 0.02 buy
2010.03.23 08:37 sell 0.09 = Close 0.02 buy, Open 0.07 sell
---
Total after 2010.03.23 08:37 0.07 sell


check, among other things, the moment of MC occurrence (from the "A" VC website)

If there are more than two locked positions, the margin requirement is calculated as follows

(open_price1*Lot1+ open_price2*Lot2+...+ open_priceX*Lotx)/(Lot1+Lot2+...+Lotx), where:

  • open_price1 - opening price of the first position;
  • open_price2 - opening price of the second position;
  • open_priceX - opening price of the position X;
  • Lotx - volume of position X in lots.

Let's take an example:

We bought gold, buy 1 lot at 932.47, sell 0.1 lot at 933.30 and sell 0.1 lot at 935.18.

(932.47*1 + 933.30*0.1 + 935.18*0.1) / (1 + 0,1 + 0,1) = 932.765

The pledge on locked positions turned out to be $932.77.

 
khorosh писал(а) >>

1. Yes, I wrote as you did, only not immediately, but after entering the profit zone.
2. DC A...and, the collateral is the same, both for 2 differently directed positions of the same lot, and for one.


Damn it, learn how to use the calculator!

Overlapped positions can be closed at any time, you do not have to wait for Breakeven. The gain is in margin release and swap reduction.
Taking into account point 2, there is a gain in swap accrual.

 
khorosh писал(а) >>

DC A...and, the margin is the same for 2 differently directed positions identical lot sizes that for one.


It's strange, but in your own pictures I see "of different lot sizes". And AI has it a few lines below.
By the way, the formula for calculating the margin for "identical lot sizes" is a special case of the formula for "unequal LOT", taking Lotx - volume of position X in lots as a constant.

 
khorosh писал(а) >>

"Overlapped positions can be closed at any time, no need to wait for breakeven." You can, but not necessarily.
DC A...i., the margin is the same for 2 differently directed positions with the same lot as it is for one.
Maybe you are right, but I haven't understood swap.


Of course, you don't have to. But there is a reason to keep the overlapped ones to breakeven only if the position control algorithm is much simpler in this variant.

And the overlapped ones should be closed only through OrderCloseBy() in order not to lose an additional spread.

Reason: