How to backtest market-on-close order with daily bars  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
robbob
Posts: 46
Joined: 26 Jan 2013
Has thanked: 2 times
Been thanked: 3 times

How to backtest market-on-close order with daily bars

Postby robbob » 01 Dec 2014

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

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: How to backtest market-on-close order with daily bars

Postby Henry MultiСharts » 02 Dec 2014

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

robbob
Posts: 46
Joined: 26 Jan 2013
Has thanked: 2 times
Been thanked: 3 times

Re: How to backtest market-on-close order with daily bars  [SOLVED]

Postby robbob » 04 Dec 2014

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


Return to “MultiCharts .NET”