I have a strategy which I would like to open a position at the market open and then close the position at the market close. Entering with MarketNextBar using the OrderCreator is not a problem, but how do I create a market order to then exit the position at the close? I tried calling the GenerateExitOnClose() method on the SignalObject, but this does not appear to work for backtesting.
Thanks,
-Rob
How to backtest market-on-close order with daily bars [SOLVED]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: How to backtest market-on-close order with daily bars
Hello Rob,
GenerateExitOnClose() works ok on our end.
Please send us (support@multicharts.com) the following information for further analysis:
- workspace you are using;
- in QuoteManager select the symbols you are using, make a right click on it->Export data->Export instrument (with data). Send us the QMD export file for analysis;
- in PowerLanguage .NET editor->File->Export->export the studies you are using for replicating this behavior; send us the pln file;
- specify the version and build number of MultiCharts you are running (in MultiCharts go to Help tab-> About).
GenerateExitOnClose() works ok on our end.
Please send us (support@multicharts.com) the following information for further analysis:
- workspace you are using;
- in QuoteManager select the symbols you are using, make a right click on it->Export data->Export instrument (with data). Send us the QMD export file for analysis;
- in PowerLanguage .NET editor->File->Export->export the studies you are using for replicating this behavior; send us the pln file;
- specify the version and build number of MultiCharts you are running (in MultiCharts go to Help tab-> About).
Re: How to backtest market-on-close order with daily bars [SOLVED]
Hi Henry,
I moved the call to the GenerateExitOnClose() method from StartCalc() method to the CalcBar() method, and seems to be working as expected now.
Thanks,
-Rob
I moved the call to the GenerateExitOnClose() method from StartCalc() method to the CalcBar() method, and seems to be working as expected now.
Thanks,
-Rob