MarketSeries.WeightedClose?

Created at 08 Jan 2016, 15:40
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!
lorddevil's avatar

lorddevil

Joined 03.01.2016

MarketSeries.WeightedClose?
08 Jan 2016, 15:40


Hello,

what exactly does the property MarketSeries.WeightedClose do?

The documentation says: Weighted price series of historical trendbar...​but this value is exactly the same as the MarketSeries.Close value.

So is this a bug or can anyone explain?

Thanks in advance,

Oliver


@lorddevil
Replies

Spotware
11 Jan 2016, 17:26

Dear Trader,

WeightedClose = (high + low + close * 2) / 4

 


@Spotware

lorddevil
11 Jan 2016, 20:41

Ok that's what I thought but then it must be a bug -> try using the MarketSeries.WeightedClose -> it is exactly the same as MarketSeries.Close!


@lorddevil

Spotware
12 Jan 2016, 16:47

Dear Trader,

We tried to reproduce your issue without success. Could you please send us some full screenshots showing it and the code you used to reproduce it? 

It will be used only for troubleshooting processes.


@Spotware

lorddevil
12 Jan 2016, 18:09

Hmm all I do is taking the last MarketSeries Close and Weighted Close Value. E.g. on a EUR/USD M1 or M5 chart?

protected override void OnBar()
{
            Print("WC: {0}", MarketSeries.WeightedClose[MarketSeries.Close.Count - 1]);
            Print("C: {0}", MarketSeries.Close[MarketSeries.Close.Count - 1]);
}

Am I doing something wrong here - as both values are always the same.


@lorddevil

lorddevil
12 Jan 2016, 18:13

Eeeek  I guess I just found the problem... if I am using the OnBar() - which is called every beginning of the candle, then the Close and Weighted Close is the same because it is not finished yet?

If so then sorry for the wrong report!!


@lorddevil

lorddevil
12 Jan 2016, 23:36

RE:

lorddevil said:

Eeeek  I guess I just found the problem... if I am using the OnBar() - which is called every beginning of the candle, then the Close and Weighted Close is the same because it is not finished yet?

If so then sorry for the wrong report!!

Yeah sorry I now have a better understanding on how OnBar() works - so surely there can't be a weighted close on the start of a new candle ;) Sorry for taking your time!


@lorddevil