Recently changed machines and did a fresh install of amibroker. Copied all my system files to the new maching. Everything seems to be working fine other than the few backtests i have where i read the signals from a csv file. I thought last time i changed machines there was an issue with this but it has been years since i did this.
So i have a signal file with Symbol, Trade (buy or sell), Date (m/dd/yyyy) columns. the code below opens the file and reads the signals. It runs in about 10 seconds on my old machine. This new one (Windows 11).... it does run... i am at a lost and would appreciate any ideas on what i may be missing (a DLL or somethign)...
typeSignalFile = "//{1B9V7A2I}//Formulas//NDU//ABO//~AEQDIVI//Signals//aflSignal~AEQDIVI.csv";
// NEWLY ADDED STOCKS FILTER////////////////////////////////////////////////////
FILTER2018DATE = Year()<2018;
FILTER2018SYM = Name()=="BF.B" OR Name()=="SPGI" OR Name()=="CB";
FILTER2018 = FILTER2018DATE AND FILTER2018SYM;
FILTERADDS = FILTER2018; // OR FILTER2019 ETC+
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
SetOption("ExtraColumnsLocation", 1 );
TotalPositions = 10;//Param("Positions",5,1,10);
PosSize = 10;
RoundLotSize = 0;
SetOption("UsePrevBarEquityForPosSizing", True);
SetOption("InitialEquity",100000);
SetOption("MinShares", 1);
SetOption("AllowPositionShrinking",True);
SetOption("AccountMargin",100);
SetOption("MaxOpenPositions", Totalpositions );
SetOption("MaxOpenLong",10);
TradeDay = DayThirdFriday;
TradeDay2 = DayThirdFriday2;
TradeMonth = m==3 OR m==6 OR m==9 OR m==12;
TradeDay=TradeDay2;// div champ IIf(Year()<=2018,TradeDay,TradeDay2);
Rebalance = tradeday AND TradeMonth;
dt = DateTime();
Buy = Sell = possize = 0;
fh = fopen( SignalFile, "r" );
if( fh )
{
while( ! feof( fh ) )
{
line = fgets( fh );
sym = StrExtract( line, 0 );
CategoryAddSymbol( sym, categoryWatchlist, Wlist );
}
fclose( fh );
}
else
{
Error( "ERROR: file can not be open" );
}
// Run and Process Trades
fh = fopen( SignalFile, "r" );
if( fh )
{
while( ! feof( fh ) )
{
line = fgets( fh );
sym = StrExtract( line, 0 );
if ( Name() == sym )
{
trade = StrExtract( line, 1 );
trade_datetime = StrToDateTime( StrExtract( line, 2 ) );
if ( trade == "Buy" )
{
newbuy = dt == trade_datetime;
Buy = Buy OR newbuy;
}
if ( trade == "Sell" )
{
newsell = dt == trade_datetime;
Sell = Sell OR newsell;
}
}
}
fclose( fh );
}
else
{
Error( "ERROR: file can not be open" );
}
SetPositionSize( 10, spsPercentOfEquity ); or paste code here