help with Close()

 

This should be pretty simple to do but I just couldn't find the documentation on it.

I'm trying to use Close(0) to represent the close of the current bar.

However when I try to use the backtest, this doesn't seem to work.

My plan is to only place orders at the close of an hourly bar, but in the journal, the backtester seems to open orders randomly during the hour. (I'm doing this on the hourly timeframe)

So is there a way to specify inside Close() that I want the close of the hourly bar?


Thanks,

 
chang14 wrote >>

This should be pretty simple to do but I just couldn't find the documentation on it.

I'm trying to use Close(0) to represent the close of the current bar.

However when I try to use the backtest, this doesn't seem to work.

My plan is to only place orders at the close of an hourly bar, but in the journal, the backtester seems to open orders randomly during the hour. (I'm doing this on the hourly timeframe)

So is there a way to specify inside Close() that I want the close of the hourly bar?

Thanks,

You can not look at the close of the current bar because it is not closed yet. That is why it is called the current bar.

whocares

 

close(0) always contains the actual value of bid/ask, changing with every tick, as whocares said, the period isnt over yet.

close(1) contains the value of the last period ending value of bid/ask, because the period is over and no further changes can occure

 
meikel:

close(0) always contains the actual value of bid/ask, changing with every tick, as whocares said, the period isnt over yet.

close(1) contains the value of the last period ending value of bid/ask, because the period is over and no further changes can occure

ah ok. that's probly where the problem is. Thanks!

Reason: