lastbaronchart_s

Questions about MultiCharts and user contributed studies.
mno
Posts: 45
Joined: 11 Feb 2010
Has thanked: 16 times
Been thanked: 5 times

lastbaronchart_s

Postby mno » 08 Jul 2012

Hi,

I have a non-regular (in this case, heiken-ashi) on a tick chart and have:

Code: Select all

if lastbaronchart_s and time > 0901 then begin
.
.
end;


The problem is that the if statement turns true before 0901 and I am wondering why. I also used "seconds" chart instead of ticks and tried

Code: Select all

if lastbaronchart_s and time_s > 090100 then ...


but same thing. It turns true before 090100.

All advice would be appreciated. Thanks.

mno

User avatar
TJ
Posts: 6551
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 966 times
Been thanked: 1892 times

Re: lastbaronchart_s

Postby TJ » 08 Jul 2012

mno wrote:Hi,

I have a non-regular (in this case, heiken-ashi) on a tick chart and have:

Code: Select all

if lastbaronchart_s and time > 0901 then begin
.
.
end;


The problem is that the if statement turns true before 0901 and I am wondering why. I also used "seconds" chart instead of ticks and tried

Code: Select all

if lastbaronchart_s and time_s > 090100 then ...


but same thing. It turns true before 090100.

All advice would be appreciated. Thanks.

mno


are you talking about real time? or backtest? or walk forward replay?

mno
Posts: 45
Joined: 11 Feb 2010
Has thanked: 16 times
Been thanked: 5 times

Re: lastbaronchart_s

Postby mno » 09 Jul 2012

In realtime...

User avatar
JoshM
Posts: 2080
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1525 times
Been thanked: 1483 times
Contact:

Re: lastbaronchart_s

Postby JoshM » 09 Jul 2012

mno wrote:The problem is that the if statement turns true before 0901 and I am wondering why.

Can you tell why that is a problem/wrong value? Is the time stamp of the last bar on your chart less than 9:01 when receiving real-time data?

Keep in mind that, if your instrument closes at, say, 17:30, the next day before the markets opens, your condition is true, since the last bar of the chart will have a time greater than 9:01. Even though your pc time is less than 9:01 (did you mean to use CurrentTime?)
These users thanked the author JoshM for the post:
mno

mno
Posts: 45
Joined: 11 Feb 2010
Has thanked: 16 times
Been thanked: 5 times

Re: lastbaronchart_s

Postby mno » 10 Jul 2012

Thanks JoshM,

I tried with a tick chart vs seconds chart, and it worked fine today - in realtime. I don't understand why this is making a difference. I will try to timestamp the first tick and see why both the conditions are both turning true. The part you mentioned about the last tick (yesterday's) being > the today's open time seem to be the culprit so far. I will look more into it and share if I find anything unusual.

mno


Return to “MultiCharts”