Thanks a lot for your response, and my sincere apologies for being not to the point in my previous message. In fact, I was struggling to make myself more clear. Here are some details attached for your reference (please see the excel picture). As I said before, I have no difficulty in connecting IB with AB and I am able to access data from IB and plot it correctly on AB. However, if you look at the attached picture of the excel sheet and AFL code (with line No 30 enabled/uncommented for MA crossover and disabled/commented for McGinely Dynamic crossover), you will see the issue very clearly.
Looking forward to hearing from you soon.
Thanks and regards
Ghanshyam

_SECTION_BEGIN("McGinley Dynamic Indicator");
SetBarsRequired( sbrAll );
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} – {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
//Initial Parameters
SetTradeDelays( 1,1,1, 1 );
SetOption( "InitialEquity", 200000);
SetOption("FuturesMode" ,True);
SetOption("MinShares",1);
SetOption("CommissionMode",2);
SetOption("CommissionAmount",100);
SetOption("AccountMargin",10);
SetOption("RefreshWhenCompleted",True);
//SetPositionSize(150,spsShares);
SetPositionSize(20,spsPercentOfEquity);
SetOption( "AllowPositionShrinking", True );
N = Param("McGinley Dynamic N ",25,5,40,5);
MD[0] = C[0];
for( i = 1; i < BarCount; i++ )
{
MD[ i ] = MD[ i - 1 ] + (C[i]-MD[i-1])/( N*(C[i] / MD[i-1])^4) ;
}
//MD = MA(C,55);
Plot( Close, "Price",colorWhite, styleCandle );
Plot(MD,"McGinley Dynamic",colorYellow,1|styleThick);
Buy=C>MD AND C>Ref(C,-1) AND Ref(C,-1)>Ref(C,-2);
Short=C<MD AND C<Ref(C,-1) AND Ref(C,-1)<Ref(C,-2);;
Sell=Short;
Cover=Buy;
BuyPrice=Open;
SellPrice=Open;
ShortPrice=Open;
CoverPrice=Open;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
_SECTION_END();