was very good - it averaged around a 1.40 profit factor.
After converted it to NT, I can't get it to break even using the exact
same data. NinjaTrader is showing a .25 profit factor. I'm obviously
missing something. Can someone please help me?
Here is the TradeStation code:
Inputs: avgLength(40), atrLength(40);
Vars: upBand(0), dnBand(0), liquidPoint(0), movAvgVal(0), movAvgVal2(0);
movAvgVal = average(((High + Low + Close)/3),40);
movAvgVal2 = average(((High + Low + Close)/3),40);
upBand = movAvgVal + AvgTrueRange(atrLength);
dnBand = movAvgVal - AvgTrueRAnge(atrLength);
if (movAvgVal > movAvgVal[1]) then Buy ("KKBuy") next bar at upBand stop;
if (movAvgVal < movAvgVal[1]) then Sell Short ("KKSel") next bar at dnBand stop;
liquidPoint = movAvgVal2;
If(MarketPosition = 1) then Sell next bar at liquidPoint stop;
If(MarketPosition = -1) then Buy To Cover next bar at liquidPoint stop;
Here is the NinjaTrader code:
protected override void OnBarUpdate()
{
if (SMA(40)[0] > SMA(40)[1])
EnterLongLimit(DefaultQuantity, (SMA(40)[0] + ATR(40)[0]), "");
if (Close[0] > SMA(40)[0])
ExitLong();
if (SMA(40)[0] < SMA(40)[1])
EnterShortLimit(DefaultQuantity, (SMA(40)[0] - ATR(40)[0]), "");
if (Close[0] < SMA(40)[0])
ExitShort();
}
Comment