MaRe8
- ago
This code worked with Build 33:
CODE:
//Run this on a single symbol public override void PostExecute(DateTime dt, List<BarHistory> participants)       {          int shares = 100;          BarHistory bh = GetHistory(participants[0], "AAPL");          Transaction t1 = PlaceTrade(bh, TransactionType.Buy, OrderType.Limit, 175);          t1.Quantity = shares;                    bh = GetHistory(participants[0], "TSLA");          Transaction t2 = PlaceTrade(bh, TransactionType.Sell, OrderType.Limit, 1010);          t2.Quantity = shares;       }


With Build 40, it only generates the buy Signal. What should I do to make this working again?
0
560
3 Replies

Reply

Bookmark

Sort
Glitch8
 ( 10.92% )
- ago
#1
Any chance you can paste the full Strategy code or email it to support@wealth-lab.com so we can examine? Is there an actual TSLA open position to sell?

What if you don't assign a Quantity to the sell? This isn't typically required, only if you are looking to sell a portion of a position.
0
MaRe8
- ago
#2
Glitch, I'm using the full code to read the signals from your daily "Deterministic Knife Juggler" email from Wealthsignals.com (thx for that by the way!). I know I could take advantage of WL7's built-in functionality, but I'm in a testing phase so I'm only trading 50% of the Quantity.

Now I have found that I can short the positions that are about to be sold, resulting in sells in IB. I can live with this workaround.

The question that remains is why the sell is not generating signals (and I need the Quantity of assets).
0
- ago
#3
If you don't have a position established, there's nothing to Sell. That's why a Short works and Sell doesn't.
0

Reply

Bookmark

Sort