We're writing strategy and got a problem with orders while backtesting
At some moment I want to submit BUY LMT order with 3X vol by Open price and submit 3 SELL LMT orders with 1X vol and other different prices
1. The best would be to set SELLs just after BUY was succeeded, but I found no signals about order execution ?
2. Using the example below I got no SELL orders execution at all
Buy("TestEnter") 3*TradeSize shares next bar at Open Limit;
Sell("Test1Exit") 1*TradeSize shares From Entry ("ATRTestEnter") next bar at Price1 Limit;
Sell("Test2Exit") 1*TradeSize shares From Entry ("ATRTestEnter") next bar at Price2 Limit;
Sell("Test3Exit") 1*TradeSize shares From Entry ("ATRTestEnter") next bar at Price3 Limit;
small issue with placing orders
Re: small issue with placing orders
Ok, there was a typo
It should be
Buy("TestEnter") 3*TradeSize shares next bar at Open Limit;
Sell("Test1Exit") 1*TradeSize shares From Entry ("TestEnter") next bar at Price1 Limit;
Sell("Test2Exit") 1*TradeSize shares From Entry ("TestEnter") next bar at Price2 Limit;
Sell("Test3Exit") 1*TradeSize shares From Entry ("TestEnter") next bar at Price3 Limit;
It should be
Buy("TestEnter") 3*TradeSize shares next bar at Open Limit;
Sell("Test1Exit") 1*TradeSize shares From Entry ("TestEnter") next bar at Price1 Limit;
Sell("Test2Exit") 1*TradeSize shares From Entry ("TestEnter") next bar at Price2 Limit;
Sell("Test3Exit") 1*TradeSize shares From Entry ("TestEnter") next bar at Price3 Limit;
- furytrader
- Posts: 354
- Joined: 30 Jul 2010
- Location: Chicago, IL
- Has thanked: 155 times
- Been thanked: 217 times
Re: small issue with placing orders
What bar interval are you using, and are you using intrabarordergeneration? If not, is it the case that no sell orders are being generated even after the bar in which you enter the market is finished?
Also, I think when you attempt to do a partial sale of a position, you should be using the TOTAL keyword - i.e.,
Also, I think when you attempt to do a partial sale of a position, you should be using the TOTAL keyword - i.e.,
Code: Select all
Sell("Test3Exit") 1*TradeSize shares TOTAL From Entry ("TestEnter") next bar at Price3 Limit;