Odd Hangup With Well-tested Custom Backtester

Hi all,

I need some ideas about what might be going wrong during a custom backtest which seems to cause Amibroker to simply hang while it is running. I am using Amibroker v6.16. I will provide code and a custom debug printout below, but first here's the background.

Background Context:
I've been using a low-level CBT for almost three years with no problems. I have not changed the CBT code at all from the pre- to post- problem period. However, recently I did three things outside of the CBT.

  1. The first thing which has changed is that I started experiencing stability problems with Amibroker, where it would simply blink out of existence randomly while I was using the editor. It would do this even without me running any code whatsoever either in analysis or verify. I was able to track down the cause of this to a Microsoft .NET DLL associated with the MS's utility Application Verifier. In the course of trying to fix the issue so Amibroker would run stably, I had to update to all the latest MS .NET MFC and VS classes on my computer. I'm now running VS 2019 and all the associated updated MS MFC libraries and utilities.

  2. After doing this, I recompiled a custom plugin I developed and have also been running for years without problems. The recompile showed no issues.

  3. The thing thing which has changed is I added a new trading method in the AFL outside the CBT and changed some other AFL code to integrate it. This code all runs prior to the ~~~EQUITY phase of backtesting. Neither this code nor any of the custom plugin code runs in the CBT, though the CBT does access some staticvars from the previous processing phases.

The Problem:
The code passes verify and also runs fine through Explore and Scan in the analysis window. However, when I run a backtest, it only runs until it finds the first signals to open trades (this occurs on bar 21). It seems to enter the first six trades fine but on the seventh call to bo.enter, Amibroker simply freezes. I have to kill the broker.exe process and start the program again.

I can see from the custom debug readout that the inputs to bo.enter are normal. This isn't an edge case as far as I can see.

I'm posting to the forum to ask for ideas, as I'm out of hypotheses to test about what might be causing it. maxopenpositions is set to 100. I'm wondering no whether Amibroker's bo object has some incompatibility with the latest MFC version but I feel that would have been reported already. Also, I can't go back to the older MFC library versions because of the instability issue they were causing.

Has anyone experienced a issue with hanging like this using the CBT bo object due to compatibility? If not, any ideas of what other things I could be looking at/testing? I'm sort of at my wit's end.

CBT Code:
Run in backtest FILTER mode, set to a custom watchlist of ticker symbols. Below the code is a readout of the debug messages at bar 21 where it hangs.

SetCustomBacktestProc("");

if (Status("action") == actionPortfolio) {
    bo = GetBacktesterObject();	//  Get backtester object
    
    bo.PreProcess();	//  Do pre-processing
	cash = bo.InitialEquity; 
	exposure = 0;
	barsInPeriod = BarCount - 1;   
	tDelay = GetTradeDelay();
	delayExists = NOT IsNull(tDelay) AND NOT AlmostEqual(tDelay, 0);
/**/	
	tStop = False;
	reentryDelay = 2;
	portOffline = 11;
	tStopLongAmt = 0.1;
	tStopShortAmt = 0.05;
	portStopAmt = 0.15;
	lastPortStop = 0;
	entryAmt = 0;
	dd = 0;
	
	if (delayExists) {
		ts = CategoryGetSymbols(categoryWatchlist, CategoryFind("TRADEDTICKERS", categoryWatchlist));
		for (index = 0; (member = StrExtract(ts, index)) != ""; ++index)   { //  Loop through all signals at this bar
			StaticVarSet(member + "PositionScore", Nz(Ref(Nz(StaticVarGet(member + "PositionScore")), -tDelay)));
		} // End for each member of TRADEDTICKERS
	} // End if delayExists

	eqHist = 0;	
    for (i = 0; i < BarCount; i++)	{ //  Loop through all bars
  
		if (GetDebug("CBT"))
			_TRACE("**********************In CBT at bar "+i+"****************************");
		eq = 0;		
		if (tStop AND i > 0) { 
			dd = MaxDD(eqHist, lastPortStop, i - 1);		
		}
		
		ts = CategoryGetSymbols(categoryWatchlist, CategoryFind("TRADEDTICKERS", categoryWatchlist));
		for (index = 0; (member = StrExtract(ts, index)) != ""; ++index) {
			trade = bo.FindOpenPos(member);			
			if (NOT IsNull(trade)) {
				if (GetDebug("CBT"))
					_TRACE("In CBT Calc Equity: Found open position on "+trade.Symbol);
				if (trade.IsLong) {
					price = GetSellArray(trade.Symbol, GetSellString());

					eq += trade.Shares*price[i];
										
			/**/	if (tStop AND i > 0) {
						if ((1 - tStopLongAmt)*entryAmt[index] >= trade.Shares*price[i] OR abs(dd) >= 100*portStopAmt) {

							_TRACE("=================================================================");
							_TRACE("Stop loss on long trade for ticker "+member+" at bar "+i);							
							_TRACE("entryAmt[index] is "+entryAmt[index]);
							_TRACE("trade.Shares is "+trade.Shares);
							_TRACE("price[i - 1] is "+price[i - 1]+" and price[i] is "+price[i]);
							_TRACE("long tolerance on value is "+(1 - tStopLongAmt)*entryAmt[index]);
							_TRACE("actual current value on long trade is "+trade.Shares*price[i - 1]);


							if (abs(dd) >= 100*portStopAmt) {
							
								if ( AlmostEqual(i, barsInPeriod)) {
									msg = StaticVarGetText("dailyActivityLog");
									msg += "\nWARNING!!!! A portfolio stop loss has been triggered"; 
									StaticVarSetText("dailyActivityLog", msg);
								} // End if i = last bar in range
								
								lastPortStop = i;
								_TRACE("***** Portfolio stop loss occurring at bar "+i);
								psStop = Nz(StaticVarGet(member+"PositionScore"));
								for (x = i + 1; x <= i + portOffline; x++) 
									if (x < BarCount) psStop[x] = 0;
								StaticVarSet(member+"PositionScore", psStop);
							} // end if portfolio level stop loss
							else {

								if ( AlmostEqual(i, barsInPeriod)) {
									msg = StaticVarGetText("dailyActivityLog");
									msg += "\nTEST WARNING!!!! A trade stop loss has been triggered for security "+member; 
									StaticVarSetText("dailyActivityLog", msg);
								} // End if i = last bar in range

								psStop = Nz(StaticVarGet(member+"PositionScore"));
								for (x = i + 1; x <= i + reentryDelay; x++) 
									if (x < BarCount) psStop[x] = 0;
								StaticVarSet(member+"PositionScore", psStop);
							} // end else trade level stop loss
							
						} // End if long trade stop loss is triggered
						
					} // End if tStop
					
					if (GetDebug("CBT"))
						_TRACE("Position value (long) was "+trade.Shares+" * "+price[i]+" = "+trade.Shares*price[i]);
				} // End if trade is long
				else {
					price = GetBuyArray(trade.Symbol, GetBuyString());

					eq -= trade.Shares*price[i];
					eqHist[i] = eq;
															
			/**/	if (tStop AND i > 0) {
						if ((1 + tStopShortAmt)*entryAmt[index] <= trade.Shares*price[i] OR abs(dd) >= 100*portStopAmt) {

							_TRACE("=================================================================");
							_TRACE("Stop loss on short trade for ticker "+member+" at bar "+i);							
							_TRACE("entryAmt[index] is "+entryAmt[index]);
							_TRACE("trade.Shares is "+trade.Shares);
							_TRACE("price[i - 1] is "+price[i - 1]+" and price[i] is "+price[i]);
							_TRACE("short tolerance on value is "+(1 + tStopShortAmt)*entryAmt[index]);
							_TRACE("actual current value on short trade is "+trade.Shares*price[i - 1]);
							
							if (abs(dd) >= 100*portStopAmt) {

								if ( AlmostEqual(i, barsInPeriod)) {
									msg = StaticVarGetText("dailyActivityLog");
									msg += "\nTEST WARNING!!!! A portfolio stop loss has been triggered "; 
									StaticVarSetText("dailyActivityLog", msg);
								} // End if i = last bar in range

								lastPortStop = i;
								_TRACE("***** Portfolio stop loss occurring at bar "+i);
								psStop = Nz(StaticVarGet(member+"PositionScore"));
								for (x = i + 1; x <= i + portOffline; x++) 
									if (x < BarCount) psStop[x] = 0;
								StaticVarSet(member+"PositionScore", psStop);
							} // end if portfolio level stop loss
							else {

								if ( AlmostEqual(i, barsInPeriod)) {
									msg = StaticVarGetText("dailyActivityLog");
									msg += "\nWARNING!!!! A trade stop loss has been triggered for security "+member; 
									StaticVarSetText("dailyActivityLog", msg);
								} // End if i = last bar in range

								psStop = Nz(StaticVarGet(member+"PositionScore"));
								for (x = i + 1; x <= i + reentryDelay; x++) 
									if (x < BarCount) psStop[x] = 0;
								StaticVarSet(member+"PositionScore", psStop);
							} // end else trade level stop loss
							
						} // End if short trade stop loss is triggered
						
					} // End if tStop
									
					if (GetDebug("CBT"))
						_TRACE("Position value (short) was "+trade.Shares+" * "+price[i]+" = "+trade.Shares*price[i]);
				} // End if trade is short					
			} // End if trade is not NULL
		} // End for each member of the TRADEDTICKERS watchlist
				
		if (GetDebug("CBT")) {
			_TRACE("CBT Calc Equity: equity is "+eq+" at bar "+i+" after adding position values");
		}
		
			eq += cash; 
			eqHist[i] = eq;

		if (GetDebug("CBT")) {
			_TRACE("CBT Calc Equity: equity is "+eq+" at bar "+i+" after cash");
			_TRACE("CBT Calc Equity: cash was "+cash);
			_TRACE("           ");
		}


		ts = CategoryGetSymbols(categoryWatchlist, CategoryFind("TRADEDTICKERS", categoryWatchlist));
		for (index = 0; (member = StrExtract(ts, index)) != ""; ++index)   { //  Loop through all signals at this bar
			ps = Nz(StaticVarGet(member+"PositionScore"))*100;
			if (LastValue(IsNull(ps))) ps = 0;
			ticker = member; //GetTicker(RetrieveWL(member));
			sigPosScore = ps[i];
			sigPosSize = -1*abs(ps[i]);
			sigSymbol = member;
			sigType = 0;
			sigIsLong = -1*(sigPosScore > 0);
			sigIsScale = 0;
			price = GetBuyArray(ticker, GetBuyString());
			sigPrice = price[i];
			sigIsEntry = 0;
			sigIsExit = 0;
			sigIsScale = 0;
			exposure[i] += abs(sigPosSize);
			if (sigPosSize < -100 AND NOT AlmostEqual(sigPosSize, -100)) {
				_TRACE("ERROR! At bar "+i+" sigSymbol allocation is greater than 1 for ticker "+sigSymbol+". sigPosSize is "+sigPosSize);
				sigPosSize = -100;
			}
				
			if (!IsNull(sigPosScore) AND sigSymbol != COMPOSITE_PREFIX+"CASH") { // AND GetAssetMgr(RetrieveWL(sigSymbol)) == TRADING_SYSTEM_MGR) {

				if (GetDebug("CBT")) {	
 					_TRACE("CBT Processing Signal: Score for symbol "+sigSymbol+" and PosScore is "+sigPosScore);
					_TRACE("CBT Processing Signal: Type is "+sigType);
					_TRACE("CBT Processing Signal: Size is "+sigPosSize+" and isLong is "+sigIsLong);
					_TRACE("CBT Processing Signal: sig.ScaleTrade is "+sigIsScale+" and sigPrice is "+sigPrice);
					_TRACE("Sig.IsEntry() : "+sigIsEntry);
					_TRACE("Sig.IsExit() : "+sigIsExit);
					_TRACE("Sig.IsScale() : "+sigIsScale);			
					_TRACE("            ");
				}

				if (!AlmostEqual(sigPosScore, 0) AND IsNull(bo.FindOpenPos(sigSymbol))) { // No currently open position
					value = (abs(sigPosSize)/100)*eq;

					if (GetDebug("CBT")) {
						_TRACE("CBT About to Enter New Trade: i is "+i+" and sig.Symbol is "+sigSymbol);
						_TRACE("CBT New Trade: sig.PosScore is "+sigPosScore+" and sig.Price is "+sigPrice+" and value is "+value);
						_TRACE("                    ");
					}

					bo.EnterTrade( i, sigSymbol, sigPosScore > 0, sigPrice, value );
					
					if (GetDebug("CBT")) {
						_TRACE("CBT Successfully exited bo.EnterTrade.");
					}
						
					/**/ entryAmt[index] = value;
					
					if (sigPosScore > 0)
						cash -= value;
					else
						cash += value;
						
					if (GetDebug("CBT")) {
						_TRACE("CBT Entered Trade: Cost was "+value+" and cash is now "+cash);
						_TRACE("                    ");
					}
					
				} // End Open a trade
				else if (AlmostEqual(sigPosScore, 0)) {
					trade = bo.FindOpenPos(sigSymbol);
					if (NOT IsNull(trade)) {
						if (trade.IsLong)
							cash += trade.Shares*sigPrice;
						else
							cash -= trade.Shares*sigPrice;		
					cash -= trade.GetCommission();
					if (GetDebug("CBT")) {
						_TRACE("CBT About to Exit Trade: i is "+i+" and sig.Symbol is "+sigSymbol+" and sig.Price is "+sigPrice);
						_TRACE("                    ");
					}
								
					bo.ExitTrade(i, sigSymbol, sigPrice);
					/**/ entryAmt[index] = 0;
					
					if (GetDebug("CBT")) {
						_TRACE("CBT Exited Trade: Cost/Proceeds"); // were "+sig.Price*trade.Shares+" and cash is now "+cash);
						_TRACE("                    ");
					}
					
					} // End trade is not null
				} // End position score is 0, close a trade	
				else {
					trade = bo.FindOpenPos(sigSymbol);
					if (NOT IsNull(trade)) {
						currPosSize = 100*((trade.Shares*sigPrice)/eq);
						currValue = (trade.Shares*sigPrice);
						longReversal = trade.IsLong AND sigPosScore < 0;
						shortReversal = sigPosScore > 0 AND NOT trade.IsLong;
						isReversal = longReversal OR shortReversal;
					}
					else {
						currPosSize = 0;
						currValue = 0;
						isReversal = False;
					}
					
					if (!isReversal) {	
						scaleIn = abs(sigPosSize) > abs(currPosSize); 
						targetValue = (abs(sigPosSize)/100)*eq;
						value = abs(targetValue - currValue);

					if (GetDebug("CBT")) {
						_TRACE("CBT About to Scale Trade: i is "+i+" and sig.Symbol is "+sigSymbol);
						_TRACE("CBT New Trade: scaleIn is "+scaleIn+" and sig.Price is "+sigPrice+" and value is "+value);
						_TRACE("                    ");
					}

						bo.ScaleTrade(i, sigSymbol, scaleIn, sigPrice, value);
						/**/ if (NOT AlmostEqual(value, 0)) 
								entryAmt[index] = targetValue;
						
						if (sigPosScore > 0) {
							if (scaleIn)
								cash -= value;
							else
								cash += value;
						} // end if scaling long trade
						else {
							if (scaleIn)
								cash += value;
							else
								cash -= value;						
						} // End else scaling a short trade
						
						if (GetDebug("CBT")) {
							_TRACE("CBT Scaled Trade: isLong was "+(sigPosScore > 0)+" scaleIn was "+scaleIn);
							_TRACE("CBT Scaled Trade: Proceeds/Cost was "+value+" and cash is now "+cash);													
							_TRACE("                    ");
						}

					} // End if not a reversal
					else {
						if (GetDebug("CBT"))
							_TRACE("CBT Scaled Trade: Trade is a reversal.");
						if (trade.IsLong)
							cash += trade.Shares*sigPrice;
						else
							cash -= trade.Shares*sigPrice;	
						cash -= trade.GetCommission();	
						if (GetDebug("CBT")) {
							_TRACE("CBT Reversal, About to Close Old Trade: i is "+i+" and sig.Symbol is "+sigSymbol);
							_TRACE("CBT Reversal: sig.Price is "+sigPrice);
							_TRACE("                    ");
						}

						bo.ExitTrade(i, sigSymbol, sigPrice);						
	
						value = (abs(sigPosSize)/100)*eq;

						if (GetDebug("CBT")) {
							_TRACE("CBT Reversal, About to Open New Trade: i is "+i+" and sig.Symbol is "+sigSymbol);
							_TRACE("CBT New Trade: sig.PosScore is "+sigPosScore+" and sig.Price is "+sigPrice+" and value is "+value);
							_TRACE("                    ");
						}

						bo.EnterTrade( i, sigSymbol, sigPosScore > 0, sigPrice, value );	
						/**/ entryAmt[index] = value;
											
						if (sigPosScore > 0)
							cash -= value; 
						else
							cash += value; 
							
						if (GetDebug("CBT")) {	
						_TRACE("CBT Entered Trade: Cost was "+value+" and cash is now "+cash);
						_TRACE("                    ");
						}

					} // End else is a reversal				
				} // End else not opening or closing a trade	

			} // End if sig.Symbol is a trading system mgr
        } // End for each signal
        
        bo.HandleStops( i );	//  Handle programmed stops at this bar
		bo.UpdateStats( i, 1 );	//  Update MAE/MFE stats for bar
        bo.UpdateStats( i, 2 );	//  Update stats at bar's end
    }	//  End of for loop over bars
    
    bo.PostProcess();	//  Do post-processing

	CAR = Nz(StaticVarGet("CAR"));
	mxDD = Nz(StaticVarGet("maxDD"));
	exposure = Sum(exposure, BarCount)/BarCount;
	expose = Nz(exposure[BarCount - 1]); 
	stats = bo.GetPerformanceStats(0);
	RAR = Nz(stats.GetValue("CAR")*(100/expose)); 
	vol = Nz(StaticVarGet("Volatility"));
	negVol = Nz(StaticVarGet("NegativeVolatility"));
	sharpe = Nz(StaticVarGet("Sharpe"));
	sortino = Nz(StaticVarGet("Sortino"));
	berg = Nz(StaticVarGet("Bergino"));
	winPCT = Nz(StaticVarGet("winPCT"));
	avgPctGain = Nz(StaticVarGet("avgPctGain"));
	avgPctLoss = Nz(StaticVarGet("avgPctLoss"));
	kelly =	Nz(StaticVarGet("kelly"));
	avgTradeLength = Nz(StaticVarGet("avgTradeLength"));
	correl = Nz(LastValue(Correlation(ROC(bo.EquityArray, 1), ROC(Foreign(INDEX_PREFIX+"GSPC", "C"), 1), barsInPeriod - 1)));
     
 	// Here we add custom metric to backtest report
	bo.AddCustomMetric( "CAR", CAR, False, False, 2, 4);
	bo.AddCustomMetric("MaxDD", mxDD, False, False, 2, 6);
	bo.AddCustomMetric( "Exposure", expose, False, False, 2, 4);
	bo.AddCustomMetric( "RAR", RAR, False, False, 2, 4);
	bo.AddCustomMetric( "Volatility", vol, False, False, 2, 4);
	bo.AddCustomMetric("NegativeVol", negVol, False, False, 2, 4);
	bo.AddCustomMetric( "Sortino", sortino, False, False, 2, 4);
	bo.AddCustomMetric( "Sharpe", sharpe, False, False, 2, 4);
	bo.AddCustomMetric("Bergino", berg, False, False, 2, 4);
	bo.AddCustomMetric("winPct", winPCT, False, False, 2, 4);
	bo.AddCustomMetric("avgPctGain", avgPctGain, False, False, 2, 4);
	bo.AddCustomMetric("avgPctLoss", avgPctLoss, False, False, 2, 4);
	bo.AddCustomMetric("kelly", kelly, False, False, 2, 4);
	bo.AddCustomMetric("avgTradeLength", avgTradeLength, False, False, 2, 4);
	bo.AddCustomMetric("Correlation to S&P 500", correl, False, False, 2, 4);
	
} // end custom backtester

Readout of custom debug code inserted into the CBT:
You can see at the end of this readout where it hangs. It picks up the trade signal for symbol VNQ along with the other inputs to bo.enter, but never exits the call.

[25548] In CBT at bar 21******
[25548] CBT Calc Equity: equity is 0 at bar 21 after adding position values
[25548] CBT Calc Equity: equity is 1e+006 at bar 21 after cash
[25548] CBT Calc Equity: cash was 1e+006
[25548]
[25548] CBT Processing Signal: Score for symbol XIV and PosScore is 0
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -0 and isLong is -0
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 24.1667
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT Processing Signal: Score for symbol UVXY and PosScore is 0
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -0 and isLong is -0
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 5692.33
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT Processing Signal: Score for symbol TMF and PosScore is 0
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -0 and isLong is -0
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 20.285
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT Processing Signal: Score for symbol TTT and PosScore is 0
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -0 and isLong is -0
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 36.23
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT Processing Signal: Score for symbol VXZ and PosScore is 0
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -0 and isLong is -0
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 52.44
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT Processing Signal: Score for symbol ZIV and PosScore is 0
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -0 and isLong is -0
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 37.4233
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT Processing Signal: Score for symbol SPY and PosScore is 4.66328
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -4.66328 and isLong is -1
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 191.463
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT About to Enter New Trade: i is 21 and sig.Symbol is SPY
[25548] CBT New Trade: sig.PosScore is 4.66328 and sig.Price is 191.463 and value is 46632.8
[25548]
[25548] CBT Entered Trade: Cost was 46632.8 and cash is now 953367
[25548]
[25548] CBT Processing Signal: Score for symbol VUG and PosScore is 2.68074
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -2.68074 and isLong is -1
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 100.173
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT About to Enter New Trade: i is 21 and sig.Symbol is VUG
[25548] CBT New Trade: sig.PosScore is 2.68074 and sig.Price is 100.173 and value is 26807.4
[25548]
[25548] CBT Entered Trade: Cost was 26807.4 and cash is now 926560
[25548]
[25548] CBT Processing Signal: Score for symbol IJH and PosScore is 3.09761
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -3.09761 and isLong is -1
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 136.21
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT About to Enter New Trade: i is 21 and sig.Symbol is IJH
[25548] CBT New Trade: sig.PosScore is 3.09761 and sig.Price is 136.21 and value is 30976.1
[25548]
[25548] CBT Entered Trade: Cost was 30976.1 and cash is now 895584
[25548]
[25548] CBT Processing Signal: Score for symbol GXC and PosScore is 0
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -0 and isLong is -0
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 69.2733
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT Processing Signal: Score for symbol PIN and PosScore is 7.50916
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -7.50916 and isLong is -1
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 19.5867
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT About to Enter New Trade: i is 21 and sig.Symbol is PIN
[25548] CBT New Trade: sig.PosScore is 7.50916 and sig.Price is 19.5867 and value is 75091.6
[25548]
[25548] CBT Entered Trade: Cost was 75091.6 and cash is now 820492
[25548]
[25548] CBT Processing Signal: Score for symbol ITE and PosScore is 19.1047
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -19.1047 and isLong is -1
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 60.5733
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT About to Enter New Trade: i is 21 and sig.Symbol is ITE
[25548] CBT New Trade: sig.PosScore is 19.1047 and sig.Price is 60.5733 and value is 191047
[25548]
[25548] CBT Entered Trade: Cost was 191047 and cash is now 629445
[25548]
[25548] CBT Processing Signal: Score for symbol MBB and PosScore is 19.8576
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -19.8576 and isLong is -1
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 109.533
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT About to Enter New Trade: i is 21 and sig.Symbol is MBB
[25548] CBT New Trade: sig.PosScore is 19.8576 and sig.Price is 109.533 and value is 198576
[25548]
[25548] CBT Entered Trade: Cost was 198576 and cash is now 430869
[25548]
[25548] CBT Processing Signal: Score for symbol VNQ and PosScore is 6.7525
[25548] CBT Processing Signal: Type is 0
[25548] CBT Processing Signal: Size is -6.7525 and isLong is -1
[25548] CBT Processing Signal: sig.ScaleTrade is 0 and sigPrice is 75.6
[25548] Sig.IsEntry() : 0
[25548] Sig.IsExit() : 0
[25548] Sig.IsScale() : 0
[25548]
[25548] CBT About to Enter New Trade: i is 21 and sig.Symbol is VNQ
[25548] CBT New Trade: sig.PosScore is 6.7525 and sig.Price is 75.6 and value is 67525