Gap opens

Questions about MultiCharts and user contributed studies.
evanscje
Posts: 34
Joined: 11 Dec 2009
Location: Arizona

Gap opens

Postby evanscje » 26 Jan 2011

I need to say - if the open >high of yesterday then sell at the open - 10 ticks stop
Data1 = S&P 500 5 minute bars
Data2=S&P 500 daily bars

I wrote:
If opend(0)>highd(1) then sell 1 contract next bar at opend(0)-2 stop;

This does not work. I don't know why.

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Gap opens

Postby Dave Masalov » 27 Jan 2011

Dear evanscje,

Do you want the entry to be triggered on the first bar of the day? Then, you should turn Intra-Bar Order Generation on.

evanscje
Posts: 34
Joined: 11 Dec 2009
Location: Arizona

Re: Gap opens

Postby evanscje » 27 Jan 2011

I thought that wouldn't be necessary since I was using a 5 minute chart but I can see (now) why it's needed.
In a similar vein - If I have a daily chart and have switched on iog and use an identical order I am getting fills at the opening tick .. is that because (in those cases) it's using the open of yesterday on that first tick (and the price is lower than yesterdays open - 2 ticks?

Can I fix this by putting in a time constraint - like if time >open+ 1 minute then begin

?

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Gap opens

Postby Dave Masalov » 28 Jan 2011

Dear evanscje,

You should add minute data series as data2 and check session time using data 2, for example:

if time data2 > 831 then...

evanscje
Posts: 34
Joined: 11 Dec 2009
Location: Arizona

Re: Gap opens

Postby evanscje » 28 Jan 2011

Great idea

evanscje
Posts: 34
Joined: 11 Dec 2009
Location: Arizona

Re: Gap opens

Postby evanscje » 28 Jan 2011

except it's not working .. I added a second data stream = 1 minute. The historical time for an indicator that is = time data2 is always equal to the last time of the the day so all back-testing fails and no historical trades are shown


Return to “MultiCharts”