MarketSeries

Created at 09 Oct 2018, 14:25
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!
RA

ranjeet.naidu@gmail.com

Joined 12.12.2017

MarketSeries
09 Oct 2018, 14:25


Hi can someone please explain how MarketSeries works.

  • What does it return when used under onBar and onTick ?
  • From the examples why is 'MarketSeries.Close.Count - 2;' used to get indicator data within onBar?
  • At what point does onBar get called. What does this mean during backtesting?

Thanks in advance.


@ranjeet.naidu@gmail.com
Replies

PanagiotisCharalampous
09 Oct 2018, 14:38

Hi Ranjeet,

"What does it return when used under onBar and onTick ?"

MarketSeries returns the OHLC and other values of a timeframe as you would have seen then on the chart. It doesn't matter where it is called, the results are the same.

"From the examples why is 'MarketSeries.Close.Count - 2;' used to get indicator data within onBar"

Which example are you referring to?

At what point does onBar get called. What does this mean during backtesting?

On the change of each bar of the selected timeframe

Best Regards,

Panagiotis


@PanagiotisCharalampous

ranjeet.naidu@gmail.com
09 Oct 2018, 14:57

Thanks for the quick reply. Not sure which example at the moment, will try and find it. 

From what I understand will calling MarketSeries from onBar return the previous OHLC as onBar is called on the open of a new bar.

Does that mean when backtesting from some date to today, the MarketSeries can only return OHLC of the previousday, which makes getting the OHLC of the last candle (todasys candle) not possible?


@ranjeet.naidu@gmail.com

PanagiotisCharalampous
09 Oct 2018, 15:00

Hi ranjeet,

That is correct. MarkerSeries can only return data that is known at the moment of the bar change, meaning up to the last closed bar.

Best Regards,

Panagiotis


@PanagiotisCharalampous

ranjeet.naidu@gmail.com
09 Oct 2018, 15:06

Will calling MarketSeries.close from within onBar return the previous data or do I need to 

var index = MarketSeries.close.count - 1;
close = MarketSeries.close[index];

Thanks


@ranjeet.naidu@gmail.com

PanagiotisCharalampous
09 Oct 2018, 15:11

Hi Ranjeet,

To get the last bar's close price, try the below

MarketSeries.Close.Last(1)

Best Regards,

Panagiotis


@PanagiotisCharalampous

ranjeet.naidu@gmail.com
09 Oct 2018, 15:23

Is there anyway to remove my email form the thread, theres no way to update in my profile.


@ranjeet.naidu@gmail.com

PanagiotisCharalampous
09 Oct 2018, 15:29 ( Updated at: 21 Dec 2023, 09:20 )

Hi Ranjeet,

Go to your profile and hover the mouse over the bottom right conrer of the general info area. A button will appear like the below.

 

Click on it and change your details.

Best Regards,

Panagiotis


@PanagiotisCharalampous

ranjeet.naidu@gmail.com
09 Oct 2018, 15:32

Already tried that but theres no way to change the user name.


@ranjeet.naidu@gmail.com