limit days

Questions about MultiCharts and user contributed studies.
juanmon
Posts: 20
Joined: 12 May 2011
Has thanked: 3 times
Been thanked: 1 time

limit days

Postby juanmon » 27 Oct 2014

hello,

Is there a way either programmatically, or within Multicharts itself to avoid a system taking a trade during a limit up or limit down day? I am testing an intraday system that, in its historical backtesting, is taking some long trades during limit up moves that wouldn't have been able to have been filled in real world trading and would like to have the system not take these trades in backtesting mode. I know this is done in some programs by not allowing a trade to be taken if the High equals the low of the bar but I can't see if there is a way to do this in Multicharts /easylanguage.

thanks

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

Re: limit days

Postby JoshM » 27 Oct 2014

I know this is done in some programs by not allowing a trade to be taken if the High equals the low of the bar but I can't see if there is a way to do this in Multicharts /easylanguage.
You mean something like this?

Code: Select all

if (High <> Low) then begin

// This code is only executed when the high is
// different from the low, so submit the limit orders here
Buy 1 contracts next bar at Low - 0.25 limit;

end;

juanmon
Posts: 20
Joined: 12 May 2011
Has thanked: 3 times
Been thanked: 1 time

Re: limit days

Postby juanmon » 27 Oct 2014

thanks for the reply. yes, something like that but I don't think this code would quite work because the relevant high <> low should be for the "next bar" and not the current bar. If I just use the high<>low it will use that formula on the current bar and take the trade on the next bar, even if that bar is a limit up day (with he high = low). including the limit order below the low, (low- .25 limit) I think would creates other issues. for instance, if high<>low (a normal bar not limit up or down) and we place a limit below this bars low, if that low is not hit on the next bar then no order would be placed, when in fact a market order should be placed.


Return to “MultiCharts”