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;
Rename
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;
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.
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.
Ok thank you,
So why does it check for null in the seventeen liner example?
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;
QUOTE:
So why does it check for null in the seventeen liner example?
It must have been overlooked when I did the conversion.
Got it.
Thanks
Thanks
Your Response
Post
Edit Post
Login is required