- ago
How can I convert this to WL7 please? I know I'm supposed to assign a Transaction t to the order and then see if it is not Null, however in the examples it always only has one order. I have 3 limits to check. I can't figure out how to handle this. Thanks

CODE:
if (BuyAtLimit((Bar + 1), LimitPrice, "Limit1") != null)    LastActivePosition.Priority = 3; if (BuyAtLimit((Bar + 1), LimitPrice2, "Limit2") != null ) LastActivePosition.Priority = 2; if (BuyAtLimit((Bar + 1), LimitPrice3, "Limit3") != null )    LastActivePosition.Priority = 1;
0
458
Solved
5 Replies

Reply

Bookmark

Sort
- ago
#1
Is this going to do it correctly?

CODE:
t = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, LimitPrice, "Limit1"); if (t != null)    t.Weight = 3; t2 = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, LimitPrice2, "Limit2"); if (t2 != null)    t2.Weight = 2; t3 = PlaceTrade(bars, TransactionType.Buy, OrderType.Limit, LimitPrice3, "Limit3"); if (t3 != null)    t3.Weight = 1;
0
Glitch8
 ( 10.92% )
- ago
#2
You need not test for null, PlaceTrade always returns a Transaction instance.

It looks OK, however Weight and Priority are reversed from WL6 to WL7. A number with a higher Weight it given a ... er ... higher weight and thus a higher priority in the sort order.

This is just one of the side effects of having WL7 based on Quantacula Studio, which was developed completely independently from WL6.
0
Best Answer
- ago
#3
Ok thank you,

So why does it check for null in the seventeen liner example?

CODE:
               var t = PlaceTrade(bars, TransactionType.Buy, OrderType.Market, default, (int)p);                if(t != null)                   t.Weight = p;
0
- ago
#4
QUOTE:
So why does it check for null in the seventeen liner example?

It must have been overlooked when I did the conversion.
0
- ago
#5
Got it.

Thanks
0

Reply

Bookmark

Sort