small issue with placing orders

Questions about MultiCharts and user contributed studies.
dada
Posts: 2
Joined: 14 Mar 2015

small issue with placing orders

Postby dada » 25 Mar 2015

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;

orion
Posts: 250
Joined: 01 Oct 2014
Has thanked: 65 times
Been thanked: 104 times

Re: small issue with placing orders

Postby orion » 25 Mar 2015

Your sell references a buy entry "ATRTestEnter" but there is no such buy entry.

dada
Posts: 2
Joined: 14 Mar 2015

Re: small issue with placing orders

Postby dada » 25 Mar 2015

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;

User avatar
furytrader
Posts: 354
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: small issue with placing orders

Postby furytrader » 26 Mar 2015

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.,

Code: Select all

Sell("Test3Exit") 1*TradeSize shares TOTAL From Entry ("TestEnter") next bar at Price3 Limit;


Return to “MultiCharts”