- ago
Some questions on BrokerAdapter:


1. I can set commission value and the way it’s calculated for backtesting. Is commission calculated for real-time trading as well? If so, where can I set it.

2. What about lot size. Every ticker (shares) on MOEX has its lot size (so, it’s something for Markets and Symbols window maybe). So the strategy says “buy 107 shares” and the lot size is 100, or the lot size is 1000. Is it up to BrokerAdapter to cut order size and to translate into lot language? And what will happen if the strategy says “buy 127” and the order will be “buy 100”. Will ClosePosition try to close 127 or 100?

3. Will WL7 correctly process partial fill of orders. E.g. your limit order is partially filled, then the price goes away and at the end of the day your broker cancels the rest of the order.

4. Can I see real-time strategies current results – equity curve or, profit sum, or a list of trades with profit results (per trade).
0
1,071
12 Replies

Reply

Bookmark

Sort
- ago
#1
Please start new topics for questions #1, $4 - they don't seem to be directly related to the BrokerAdapter API. Thanks.
0
- ago
#2
Eugen, done. But still no way to edit initial post, so 1, 4 stay here too.
0
Cone8
 ( 22.68% )
- ago
#3
QUOTE:
2. Is it up to BrokerAdapter to cut order size and to translate into lot language?

What other options are there? 1 - script; 2 - broker provider

QUOTE:
2b. And what will happen if the strategy says “buy 127” and the order will be “buy 100”. Will ClosePosition try to close 127 or 100?
If the hypothetical position has 127, then 127. Your intraday broker provider should be able to get a position's size and change it.

QUOTE:
3. Will WL7 correctly process partial fill of orders.

It's the adapter's job, of course. Set the SignalStatus correctly, then it will be correct.

QUOTE:
E.g. your limit order is partially filled, then the price goes away and at the end of the day your broker cancels the rest of the order.
If you're auto-trading, and you get a partial fill, WL7 will issue a cancel order if the [intraday] script doesn't refresh the limit order. But you can handle this any way you want in your adapter. i.e., if (order_partially_filled) don't_cancel;
0
- ago
#4
Cone,

1. WL will use "filled qty" or "qty" to undestanding position size and qty for cover/close position?

2. Could I get access to position class instance from transaction class instance inside broker adapter's class?
0
- ago
#5
QUOTE:
What other options are there? 1 - script; 2 - broker provider


WL7' backtester has an option "Convert trade quantities to Round Lots". You could do the same for live trading... but not just round, but get the lot size from "Markets and Symbols" and round the the signal volume by lot size, but still output in shares, not in lots.

And it is BrokerAdapter, that convert shares to lots if needed (using "Markets and Symbols" agani).

So what we have - there is no need for BrokerAdapter to cut the size, no any problem with difference in signal size and trade size and so on.
0
- ago
#6
Hello.

Any new idea on this?)

I'm affraid we cannot manage it gracefully on just our side.
0
Glitch8
 ( 12.83% )
- ago
#7
Is the desired feature the ability for WL7 to adjust the size of exit orders quantity based on the actual position held in the live account? This is something in the backlog.
0
- ago
#8
Closing a position according to its actual size looks like minimum what is needed yes.

But the full and the best decision (as for me) looks like this: you have a lot size field for symbols in your Markets and Symbols. And when processing a signal WL7 cuts the volume (rounds to the floor), e.g. if the strategy says buy 297 shares, WL7 looks at Symbols and Markets and finds the lot size = 100 for the symbol. So the volume that comes to BrokerProvider is 200. The BrokerProvider (it's our side) looks again to Markets and Symbols and get 2 out of 200 (200/100).

And (important, I guess), what about partially filled orders. E.g. you have have order with 200 shares volume, it's partially filled and has 100 shares left. If closing position according to it's actual size works, WL7 will close 100 shares. What will be with 100 shares of unfilled opening order. Will it be canceled? If it will not, will the position generated by it ever closed?
0
Glitch8
 ( 12.83% )
- ago
#9
If the order is the result of an automated trading strategy, then the next time that strategy submits a batch of orders for that symbol (or sends its signal that no orders were submitted that interval) then WL7 will cancel that partially filled active order.

0
Glitch8
 ( 12.83% )
- ago
#10
On a side note, are you a member of our Discord? You should join because we could then do more direct communication and I can perhaps help with the development and rollout of your extension in other ways. I did this with DrKoch (finantic.de) and as you can see from the Extension page he has his own little corner of extensions now :)
0
- ago
#11
No, I'm not. How can I do that?)

Still I'm not a programmer, but a trader), but I deal with programmers, Including making broker adapters and so on.
0
Glitch8
 ( 12.83% )
- ago
#12
You can use the web Discord or install the application (which is better), here is an invite link to the WL7 Discord channel ... pass this on to the programmer(s) too

https://discord.gg/sqFQESRaAW

0

Reply

Bookmark

Sort