Problem with IntraBarOrderGeneration

Questions about MultiCharts and user contributed studies.
bibulous
Posts: 56
Joined: 16 Apr 2010
Has thanked: 17 times
Been thanked: 2 times

Problem with IntraBarOrderGeneration

Postby bibulous » 03 Aug 2010

Hi,

I have a problem with in MC6 and enabled IntraBarOrderGeneration. In the backtest the strategy works fine, but in live trading there are no orders being generated at all. And I do not get my head around what I am doing wrong.
The strategy logic is like this:

Code: Select all

if Barstatus(1) = 2 then
begin
Signal = 0;
{calculate entry condition}

if CurrentBar > 1 and MarketPosition = 0 and MyEntryCondition
then begin
LowerBound = L - (MinMove / PriceScale);
UpperBound = H + (MinMove / PriceScale);
Signal = 1;
end;
end;

if MarketPosition = 0 and Signal = 1
and time > SessStartTime and time < SessEndTime
then begin
if C < UpperBound
buy ("ENTRY L") 1 contracts next bar (UpperBound) stop;

if C > LowerBound
sellshort ("ENTRY S") 1 contracts next bar (LowerBound) stop;
end;

if MP = 1 then begin
{calculate target / stop}
sell ("LX") 1 contracts next bar longTarget limit;
sell ("LS") 1 contracts next bar longStop stop;
end;

if MP = -1 then begin
{calculate target / stop}
buytocover ("SX") 1 contracts next bar shortTarget limit;
buytocover ("SS") 1 contracts next bar shortStop stop;
end;
Signal, LowerBound, UpperBound and the long/short Target/Stop are

Code: Select all

IntraBarPersist
if that makes a difference..
It cannot see what should be different in backtest than it is in live trading. Any help is greatly appreciated.

Marc

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

Re: Problem with IntraBarOrderGeneration

Postby TJ » 03 Aug 2010

have you tested your logic with an indicator?

e.g.

change the following line

Code: Select all

if C < UpperBound then
buy ("ENTRY L") 1 contracts next bar (UpperBound) stop;
to

Code: Select all

if C < UpperBound
plot10( h, "ENTRY L") // set this plot style to a large dot
else
noplot(10);

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

Re: Problem with IntraBarOrderGeneration

Postby TJ » 03 Aug 2010

Hi,

I have a problem with in MC6 and enabled IntraBarOrderGeneration. In the backtest the strategy works fine, but in live trading there are no orders being generated at all. And I do not get my head around what I am doing wrong.
The strategy logic is like this:
...
were you testing with bar precision?

bibulous
Posts: 56
Joined: 16 Apr 2010
Has thanked: 17 times
Been thanked: 2 times

Re: Problem with IntraBarOrderGeneration

Postby bibulous » 03 Aug 2010

have you tested your logic with an indicator?
Good idea. Haven tried this yet!

bibulous
Posts: 56
Joined: 16 Apr 2010
Has thanked: 17 times
Been thanked: 2 times

Re: Problem with IntraBarOrderGeneration

Postby bibulous » 03 Aug 2010

were you testing with bar precision?
I have tried with and without the "Bar Magnifier" (Intra-day 1 minute) on the 1H data series. In both settings trades are being generated.

bibulous
Posts: 56
Joined: 16 Apr 2010
Has thanked: 17 times
Been thanked: 2 times

Re: Problem with IntraBarOrderGeneration

Postby bibulous » 08 Aug 2010

"somehow" this seems to work now. I do not remember changing anything though. Weird. Anyway, now with every tick the same (entry stop) order is canceled and re-send by MultiCharts. Is there a way to prevent this? For example is it possible with IOG to set that the order is only canceled at a new bar by MC? Or to "manually" cancel the orders?


Return to “MultiCharts”