- ago
Hello everybody!

How can I quickly identify the strategy which opened each of my Interactive Brokers multiple positions during swing trading?

When running several strategies opening a lot of positions after a couple of days I get lost.
0
478
Solved
12 Replies

Reply

Bookmark

Sort
- ago
#1
Hola,

What do you mean by "identify", in which tool?
0
Cone8
 ( 28.25% )
- ago
#2
There is no way. Any strategy (or non strategy) could have traded any instrument in any account. If you don't want different strategies to trade the same shares/contracts you must:

1. use different accounts, or,
2. make sure that the DataSet's symbols are different for each strategy, or,
3. Turn off Portfolio Sync and use fixed sizing (this can't guarantee that a hypothetical strategy won't trade other shares).
1
- ago
#3
Good answer.

Now I know I can't easily identify which position belongs to which strategy. I trade several strategies on the same datasets.

Would it be possible in a future, to create a mark on the trade with the name of the strategy so it can be recognizable in TWS?
0
Cone8
 ( 28.25% )
- ago
#4
The problem is that there is no mechanism to link shares at a broker to a strategy. I can't think of anything in any broker API that would support it. And, I personally wouldn't want WealthLab to prevent me from using Strategy B to sell shares from Strategy A.

There are something like 8000 stocks in the U.S. market alone. Probably you can find correlations of nearly '1' for any number of stocks. The obvious simple solution is to trade different instruments with different strategies.
1
MIH8
- ago
#5
Attaching strategies to symbols (as symbols are currently assigned to the strategies) would give you control over how many shares belong to a strategy. This way, a strategy would know how to split symbols into the appropriate pieces on the brokerage side, even if they are held in one position. This is only a hypothetical solution and not provided for in WL Design. Maybe this can be an idea for the future.
1
Cone8
 ( 28.25% )
- ago
#6
I'm not seeing the difference. You can attach strategy to symbols by putting them in DataSets on which the Strategy operates. The problem begins when 2 strategies are "attached" to the same symbol.

It only begins there because with all the other preferences offered, there are many possibilities that depend on:

1. the strategy trade types (even if a strategy A is long and B is short, these orders would trade the same position at brokers like IB).

2. But generally, the strategies are long and these Portfolio Sync options aren't compatible with multiple Strategies trading the same Position :

a. Reduce size (if reducing size, it's possible the larger share size was traded by another strategy)

b. Exit full Position Qty (shares usually reported by the broker as one position, so one strategy would exit shares contributed by multiple strategies)

c. Live Positions (this option would make shares added by one strategy appear to be live in all strategies trading the same symbol)

The only practical solution I can think of at the moment is a "Track Fills" option. WL could keep track of fills, associating them with a strategy. But it would be cached on the local machine, so it's far from fool-proof. (Can you say that nowadays?)
2
Best Answer
- ago
#7
QUOTE:
The only practical solution I can think of at the moment is a "Track Fills" option. WL could keep track of fills, associating them with a strategy. But it would be cached on the local machine, so it's far from fool-proof. (Can you say that nowadays?)


This is a great idea. Could I post as a #featurerequest ? Should I make a new post?
0
MIH8
- ago
#8
Hi Cone.

I'm not sure we understand each other. For example, the "idea" I was talking about looks like this.

Symbol.RunStrategy("KnifeJuggler");
Symbol.RunSrategy("OneNight");

Now when KnifeJugler is run in the context of the symbol, it knows how many shares it has bought and needs to sell.
Likewise for any other strategy that runs in parallel for the symbol.

If KnifeJuggler now buys 5 shares and OneNight 10, the broker will now hold 15 shares in one position.
However, each strategy takes its share out of the position.

The difference looks simplified as follows.

Idea: Dataset.Symbol.RunStrategy("STRATEGY")
StatusQuo: Strategy.Run(DATASET.Symbol)

Finally it is not important at this point. It is just an idea which in the current design is not realised.

Above all, without evaluation, simply a different approach.
1
Cone8
 ( 28.25% )
- ago
#9
You're right that I don't know what you're talking about, except that it seems like your idea is to create a one-to-one relationship between Symbol-and-Strategy (which you can already do pretty easily with custom DataSets).

We're past that. The discussion revolves around creating the ability to trade the same symbol with multiple strategies, while somehow keeping synchronization with the broker account. That's a one (symbol)-to-many (strategies) relationship. Your pseudo-code idea doesn't begin to address that.
1
MIH8
- ago
#10
It does, maybe i do not explain it well, that's all.

AAPL.RunStrategy("KnifeJuggler");
AAPL.RunStrategy("OneKnight");
TSLA.RunStrategy("KnifeJuggler");
TSLA.RunStrategy("OneKnight");
TSLA.RunStrategy("Cat Power");

This snippet should tell you that many Strategies can be called from one symbol. I don't see a 1:1 relation anywhere. The difference you don't see is that the strategy is still executed in a symbol context. It is about one strategy referenced/injected via Parameter.

In such a design, a position can be broken down into its parts on the broker side. If you have 15 shares of AAPL, AAPL's contextual strategies will split the position (from broker) into the right shares

Currently, a symbol is passed as a parameter to a Strategy. There is no connection between different strategies. This leads to the problem that one cannot tell whether 15 shares have been created on the basis of 5, 7 or 2 strategies, or simply which strategies. Well, exactly the task you try to create a solution for.

However, if the strategy is called in the context of a symbol, it is possible to say which, in the example 2 strategies, have built up the position and it is clear how the position is closed again. Portfolio (Dataset) Backtesting is the heartbeat of WL, it would work like this.

foreach(symbol in Portfolio/Dataset)
{
variant1: symbol.RunStrategies()
variant2: symbol.RunStrategy("X")
}

All symbols which run the KnifeJuggler are running the same instance, not different versions of that strategy. In general you can collect the results, metrics and so on as before.

1. I understood very well what the problem is, and i addressed it correctly
2. I am aware that it is not a solution in the current Software design. That' why i call it an idea (for a major upgrade)
3. Your interpretation (of what i wrote) has nothing in common with what I wrote. Ok, maybe i expressed the idea not very well, my bad.
1
Cone8
 ( 28.25% )
- ago
#11
Great. I'm looking forward to your trading solution to synchronizing broker positions.
0
MIH8
- ago
#12
Sorry, i can't follow your reaction (another time). What exactly do you think would not work? Why don't you give some content to understand you better?

Well, i really believe you have a good arguments for your opinion. But you should point to the weaknesses you seem to know about with the presented idea.
0

Reply

Bookmark

Sort