multi symbol indexes

Created at 25 Dec 2013, 23:55
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!
lec0456's avatar

lec0456

Joined 14.11.2012

multi symbol indexes
25 Dec 2013, 23:55


will indexes from different symbols but the same timeframe be the same?

 

example, 

 msUSDJPY = MarketData.GetSeries("USDJPY",TimeFrame.Minute5);
 msGBPUSD = MarketData.GetSeries("GBPUSD",TimeFrame.Minute5);

 

can I use:  msUSDJPY.Close[index];  if I'm using the same timeframe or because I am attached to a EURUSD symbol do I need to get and index.  like so, var idxUSDJPY =msUSDJPY.OpenTime.GetIndexByTime(MarketSeries.OpenTime[index]);

 


@lec0456
Replies

Spotware
26 Dec 2013, 09:15

Indexes from different symbols are different. You should always use GetIndexByTime or GetIndexByExactTime to get index by open time.


@Spotware

lec0456
26 Dec 2013, 22:24

Ok, I realized there was a difference and wanted to verify.  But here is another thing.  Even if they start on different numbers lets say an index for GBPUSD starts at 10 and EURUSD starts at 1.  Lets say you are on a 5 min chart, in an hours time you will not always get 12 periods because sometimes the series skips!!!  I see times where it jumps from 00:35 to 00:45.  This can screw up a lot of calculations.  

could there be a setting so that periods with no activity still get a mark?  I've heard of a such a setting on other platforms.


@lec0456

Spotware
30 Dec 2013, 16:14

The reason for this is probably the absence of prices at the time. If you use GetIndexByTime this will return the index of the bar of the previous open time if the open time passed in the parameter does not exist.


@Spotware

lec0456
30 Dec 2013, 22:07

ok, thanks


@lec0456