why different ATR values from different cTRADER Brokers
why different ATR values from different cTRADER Brokers
04 Jan 2016, 20:51
Hi SpotWare,
why am I getting two different set of ATR Value when using the same code from two different BROKERS (FxPro and RoboForex), using the cTRADER platform.
Have attached the Screen Shot for your review and the Code I am using to access the ATR values.
So any particular reason, why we get two different set of ATR values ??? Also, from morning not able to get the ATR values for EURNZD, CADJPY when using the below code line !!! is there any problem going on with cTRADER Server. (*the Chart is loading of these two pairs)
Thank you.
///S.Khan
// ATR INDICATOR INSTANCE ///////////////////// private AverageTrueRange ATR_Indicator_1; private AverageTrueRange ATR_Indicator_2; private AverageTrueRange ATR_Indicator_3; //GLOBAL VARIABLES Symbol t_Symbol; string tstr_Code; double t_1, Current_ATR_V1, Current_ATR_V2, Current_ATR_V3 ; //LOOP for (int i = 0; i < 7; i++) { t_Symbol = Get_Pair_Symbol(i); tstr_Code = t_Symbol.Code.ToString(); t_1 = t_Symbol.PipSize; // MONTHLY var temp_1 = MarketData.GetSeries(tstr_Code, TimeFrame.Monthly); ATR_Indicator_1 = Indicators.AverageTrueRange(temp_1, 2, MovingAverageType.Simple); // WEEKLY var temp_2 = MarketData.GetSeries(tstr_Code, TimeFrame.Weekly); ATR_Indicator_2 = Indicators.AverageTrueRange(temp_2, 3, MovingAverageType.Simple); // DAILY var temp_3 = MarketData.GetSeries(tstr_Code, TimeFrame.Daily); ATR_Indicator_3 = Indicators.AverageTrueRange(temp_3, 5, MovingAverageType.Simple); Current_ATR_V1 = Math.Round(ATR_Indicator_1.Result.LastValue / t_1, 0); Current_ATR_V2 = Math.Round(ATR_Indicator_2.Result.LastValue / t_1, 0); Current_ATR_V3 = Math.Round(ATR_Indicator_3.Result.LastValue / t_1, 0); Print(i + ". " + tstr_Code + " = " + Current_ATR_V1 + ", " + Current_ATR_V2 + ", " + Current_ATR_V3); } //END FOR //METHOD GET SYMBOL private Symbol Get_Pair_Symbol(int t_Pair) { switch (t_Pair) { case 0: return MarketData.GetSymbol("EURUSD"); break; case 1: return MarketData.GetSymbol("EURJPY"); break; case 2: return MarketData.GetSymbol("EURGBP"); break; case 3: return MarketData.GetSymbol("EURAUD"); break; case 4: return MarketData.GetSymbol("EURNZD"); break; case 5: return MarketData.GetSymbol("EURCAD"); break; case 6: return MarketData.GetSymbol("EURCHF"); break; } return Symbol; }
Replies
DeletedUser2
07 Jan 2016, 08:38
RE:
You might want to check the data your receiving from the different brokers matches, as in the start time of the data feed, and the period you are calculating over, this can lead to varying values.
@DeletedUser2
GoldnOil750
07 Jan 2016, 08:45
( Updated at: 23 Aug 2022, 15:25 )
RE: RE:
Thank you !!!
DeletedUser said:
You might want to check the data your receiving from the different brokers matches, as in the start time of the data feed, and the period you are calculating over, this can lead to varying values.
@GoldnOil750
Spotware
04 Jan 2016, 22:26
Dear Trader,
We cannot see anything wrong. Brokers can have different Liquidity Providers and therefore there will be differences in execution. In fact, the same Liquidity Providers can stream different feeds to different clients.
@Spotware