Unable to Scan/Explore/Backtest for IB symbols

Hi, I am facing a strange problem while running any of the Scan/Explore/Backtest if I filter the symbols from Interactive Brokers. Everything is working fine with the symbols from Yahoo/NSE, but it is not working if I use a watchlist of IB symbols. Regarding IB, I have data from 1st-Jan-2022 and if I plot the data on the Chart, it is showing correct Buy/Short signals (arrows), but if I want to either Scan, Explore, or want to do the Backtesting using Data from IB, nothing comes (No results).

Kindly help
Best regards

When you work with IB, you need to read the manual:
https://www.amibroker.com/guide/h_ib.html

Especially entire part called: HOW TO USE BACKFILL FEATURE

Other than that, your post does not provide all necessary details to give you an answer. Please follow this advice: How to ask a good question

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
IB_AB_Issue


_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();

I have taken the above code from the following link:

You might have less data than required by the formula. Check the BarCount using _TRACE

To get better understanding of what is happening in your code and how functions work, use advice given here: How do I debug my formula?

That was a big clue, yes, there was an issue with the data size, the Yahoo data set was of nearly 3 years, whereas IB dataset is not even 3months old (I bought Amibroker on the 1st of Jan this year). But there is a fix to it, in the settings, if we use "Appropriate Symbol" for padding and aligning, even with such a small IB dataset it would work. And that is what exactly I did. Thanks again for your response.

Best regards

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.