But it didn't help me.
Let me show you my code:
namespace NinjaTrader.NinjaScript.Strategies
{
public class JJcrossCode : Strategy
{
private bool Falling1;
........
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Strategy here.";
Name = "JJcrossCode";
......
Falling1 = true;
}
else if (State == State.Configure)
{
}
else if (State == State.DataLoaded)
{
SetProfitTarget(@"Short", CalculationMode.Ticks, 20);
}
}
protected override void OnBarUpdate()
{
if (BarsInProgress != 0)
return;
if (CurrentBars[0] < 7)
return;
// Set 1
if ((Open[0] > Close[0])
&& (High[0] < High[1])
&& (Low[0] < Low[1]))
{
Falling1 = false;
Draw.Text(this, @"Falling1", "", 0, 0);
Console.WriteLine("Hello World!");
}
// Set 2
if (
// 01-crossabovelower
((CrossAbove(JurbolBBmacd1.Macd, JurbolBBmacd1.BollingerLower, 3))
&& (Times[0][0].TimeOfDay >= new TimeSpan(8, 30, 0))
&& (Times[0][0].TimeOfDay <= new TimeSpan(15, 0, 0))
&& (RSI1.Avg[0] < 67)
&& (Falling1=true)
// 02-crossaboveuper
|| ((CrossAbove(JurbolBBmacd1.Macd, JurbolBBmacd1.BollingerUpper, 3))
&& (IsFalling(ParabolicSAR1) == false)
&& (IsFalling(AuSuperTrendU111.StopDot) == false)
&& (Times[0][0].TimeOfDay >= new TimeSpan(8, 30, 0))
&& (Times[0][0].TimeOfDay <= new TimeSpan(15, 0, 0))
&& (RSI1.Avg[0] < 67)
&& (IsFalling(Momentum1) == false)
)
{
EnterLong(Convert.ToInt32(Size), @"Long");
}
}
The issue is that it seems the system can't recognize && (Falling1=true) in // 01-crossabovelower,I guess there are some structure issues in my code.

Comment