Same Open and Close values on Backtesting

Created at 26 Nov 2012, 00:38
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TA

tank6b

Joined 26.11.2012

Same Open and Close values on Backtesting
26 Nov 2012, 00:38


Hi,

 

I'm getting the same values for Open and Close prices on backtesting. This is a bug right?

 

This is the drop of all prices for the EUS/USD on 1M bar

10/25/2012 12:01:00 AM, 001.297390, 001.297390, 001.297390, 001.297390, 001.297390, 001.297390, 001.297390

10/25/2012 12:02:00 AM, 001.297330, 001.297330, 001.297330, 001.297330, 001.297330, 001.297330, 001.297330

10/25/2012 12:03:00 AM, 001.297120, 001.297120, 001.297120, 001.297120, 001.297120, 001.297120, 001.297120

 

Thanks in advanced


@tank6b
Replies

admin
26 Nov 2012, 12:25

Could you please post the code you are using to generate these results?

 

The OnBar event will generate the same values which are equal to the open price. You may use the previous to the last trendbar if this is the case.

 


@admin

magico
28 Nov 2012, 14:17

RE:
tank6b said:

Hi,

 

I'm getting the same values for Open and Close prices on backtesting. This is a bug right?

 

This is the drop of all prices for the EUS/USD on 1M bar

10/25/2012 12:01:00 AM, 001.297390, 001.297390, 001.297390, 001.297390, 001.297390, 001.297390, 001.297390

10/25/2012 12:02:00 AM, 001.297330, 001.297330, 001.297330, 001.297330, 001.297330, 001.297330, 001.297330

10/25/2012 12:03:00 AM, 001.297120, 001.297120, 001.297120, 001.297120, 001.297120, 001.297120, 001.297120

 

Thanks in advanced

I think you may be using something like MarketSeries.Open.LastValue, which gives the value of the current bar.
Try MarketSeries.Open [MarketSeries.Open.Count-2], and see the values of the previous bar you're viewing.

@magico