Time filtering in backtesting.

Questions about MultiCharts .NET and user contributed studies.
zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

Time filtering in backtesting.

Postby zysmn » 27 Feb 2014

Hello, I'm new in C# and Multicharts.NET.
First question:How I can do that during backtesting some signals filtered within a certain period of time? for example, on hour interval to ignore signals from 10-15 to 10-45.

Second question: how during testing can send market order at the current price, and not on the current bar closing/ next opening. For example, on hourly interval when the price touched MA place an order at the current price.
Thank you.

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1542 times
Been thanked: 1565 times
Contact:

Re: Time filtering in backtesting.

Postby JoshM » 27 Feb 2014

Hello, I'm new in C# and Multicharts.NET.
First question:How I can do that during backtesting some signals filtered within a certain period of time? for example, on hour interval to ignore signals from 10-15 to 10-45.
You might want to check out this very recent thread.
Second question: how during testing can send market order at the current price, and not on the current bar closing/ next opening. For example, on hourly interval when the price touched MA place an order at the current price.
Thank you.
With intra-bar order generation (IOG) this can be done. See page 49 of the programming manual.

zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

Re: Time filtering in backtesting.

Postby zysmn » 27 Feb 2014

You might want to check out this very recent thread.
Thanks, when I post my topic the message #4 was not yet.
With intra-bar order generation (IOG) this can be done. See page 49 of the programming manual.
I already tried to use it, but orders still sends with the close price.
(I used {buy_order = OrderCreator.MarketThisBar(...)})

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1542 times
Been thanked: 1565 times
Contact:

Re: Time filtering in backtesting.

Postby JoshM » 27 Feb 2014

Second question: how during testing can send market order at the current price, and not on the current bar closing/ next opening. For example, on hourly interval when the price touched MA place an order at the current price.
I already tried to use it, but orders still sends with the close price.
(I used {buy_order = OrderCreator.MarketThisBar(...)})
What is your goal/what do you want to achieve?

When you said "send market order at the current price", I thought you mean "send a market order at the current tick". Since IOG did not solve your issue, did you mean to say "send market order for the current price"? (i.e. a buy stop order) But then I don't see how your MA example would fit in, since you probably don't want to send a buy stop order for the MA price that is already touched.

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

Re: Time filtering in backtesting.

Postby Henry MultiСharts » 28 Feb 2014

zysmn, please turn on Bar Magnifier for your backtesting. For more information please see How Signals are Calculated.

zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

Re: Time filtering in backtesting.

Postby zysmn » 03 Mar 2014

Henry MultiСharts, JoshM thank you for your replies. When i tried to enable "Intrabar order generation" with "Bar Magnifier", all trades disappeared from the chart, and also "Strategy Data" lines disappeared from "data window". I don't understand why? In this example i used MovAvg_Cross_SE + MovAvg_Cross_SX.

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

Re: Time filtering in backtesting.

Postby Henry MultiСharts » 03 Mar 2014

zysmn, please go to Format->Signals->Make sure the status of both signals is "On".
Then go to Format->Window->Status line->make sure Status line is enabled and the "Study" option is checked.
Can you see "Calculating..." message in the status line of the chart?

zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

Re: Time filtering in backtesting.

Postby zysmn » 03 Mar 2014

Both signal status is ON,Status line is enable,and all needed options is checked."calculating..." message appears. When I uncheck "Intrabar order generation",signals appears again. If you want, I can post screenshot.

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

Re: Time filtering in backtesting.

Postby Henry MultiСharts » 03 Mar 2014

The issue with using MovAvg_Cross_SE/LE + IOG has been confirmed. The fix is targeted to MultiCharts 9.0

zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

Re: Time filtering in backtesting.

Postby zysmn » 04 Mar 2014

When i use XAverage() AverageFC() function in my own signals, i have same problem. Will they be also fixed?

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

Re: Time filtering in backtesting.

Postby Henry MultiСharts » 04 Mar 2014

Yes, the soruce of the issue lies in the functions used by the signals.

zysmn
Posts: 68
Joined: 27 Feb 2014
Has thanked: 7 times
Been thanked: 4 times

Re: Time filtering in backtesting.

Postby zysmn » 04 Mar 2014

ok, thank you.


Return to “MultiCharts .NET”