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.
Time filtering in backtesting.
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Time filtering in backtesting.
You might want to check out this very recent thread.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.
With intra-bar order generation (IOG) this can be done. See page 49 of the programming manual.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.
Re: Time filtering in backtesting.
Thanks, when I post my topic the message #4 was not yet.You might want to check out this very recent thread.
I already tried to use it, but orders still sends with the close price.With intra-bar order generation (IOG) this can be done. See page 49 of the programming manual.
(I used {buy_order = OrderCreator.MarketThisBar(...)})
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Time filtering in backtesting.
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.
What is your goal/what do you want to achieve?I already tried to use it, but orders still sends with the close price.
(I used {buy_order = OrderCreator.MarketThisBar(...)})
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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Time filtering in backtesting.
zysmn, please turn on Bar Magnifier for your backtesting. For more information please see How Signals are Calculated.
Re: Time filtering in backtesting.
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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Time filtering in backtesting.
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?
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?
Re: Time filtering in backtesting.
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.
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Time filtering in backtesting.
The issue with using MovAvg_Cross_SE/LE + IOG has been confirmed. The fix is targeted to MultiCharts 9.0
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2957 times
Re: Time filtering in backtesting.
Yes, the soruce of the issue lies in the functions used by the signals.