Time of day restraints in code and odd bid/ask performance

Questions about MultiCharts and user contributed studies.
jr123
Posts: 5
Joined: 10 Dec 2012

Time of day restraints in code and odd bid/ask performance

Postby jr123 » 10 Jan 2013

Very sorry if this has been covered on the boards, but I was unable to do a satisfactory search due to common search terms.

I have some basic signals operating together as an autotrader, i.e. LE, LX, SE, SX - I would like to limit these to be backtested to a certain time of the day, every day, e.g. say 6am to 9pm as I don't want it traded 24 hours - I am not sure how to do this properly in the script of each signal using Multicharts and would be grateful to be pointed in the right direction.

Also I wondered if anyone could think of a common reason for this - I have backtested my code on trade and then on bid/ask. On the latter, the performance is truly terrible, giving big losses every day. Interesting. Yet if I auto trade the system live, the performance is more like the trade results per day (a small gain) and the bid/ask strategy version for that day showing a loss that was not suffered. Is there anything obvious I could possibly be doing wrong? I'm not mixing up time units or anything like that. Even using 4 hour bars it is showing a big difference, which seems counter intuitive to the effects of an ECN spread.

Many thanks for all your help.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Time of day restraints in code and odd bid/ask performan

Postby TJ » 10 Jan 2013

Very sorry if this has been covered on the boards, but I was unable to do a satisfactory search due to common search terms.

I have some basic signals operating together as an autotrader, i.e. LE, LX, SE, SX - I would like to limit these to be backtested to a certain time of the day, every day, e.g. say 6am to 9pm as I don't want it traded 24 hours - I am not sure how to do this properly in the script of each signal using Multicharts and would be grateful to be pointed in the right direction.

Also I wondered if anyone could think of a common reason for this - I have backtested my code on trade and then on bid/ask. On the latter, the performance is truly terrible, giving big losses every day. Interesting. Yet if I auto trade the system live, the performance is more like the trade results per day (a small gain) and the bid/ask strategy version for that day showing a loss that was not suffered. Is there anything obvious I could possibly be doing wrong? I'm not mixing up time units or anything like that. Even using 4 hour bars it is showing a big difference, which seems counter intuitive to the effects of an ECN spread.

Many thanks for all your help.
You can start here:
Autotrade / Backtest / Optimization FAQ
viewtopic.php?f=16&t=10811


Return to “MultiCharts”