#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
// This namespace holds all strategies and is required. Do not change it.
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class ChandySARBaseLong830 : Strategy
{
#region Variables
// Wizard generated variables
private double chandyRounded = 0; // Default setting for ChandyRounded
private double chandyRemainder = 0; // Default setting for ChandyRemainder
private double roundUp = 0; // Default setting for RoundUp
private double roundDown = 0; // Default setting for RoundDown
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
CalculateOnBarClose = true;
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
chandyRounded = Math.Truncate( ChandelierSAR(5, 3.5).Chandelier[0]);
chandyRemainder = ChandelierSAR(5, 3.5).Chandelier[0] - chandyRounded;
// Condition set 1
if (DefaultInput[0] < ChandelierSAR(5, 3.5).Chandelier[0]
&& ToTime(Time[0]) > ToTime(8, 30, 0)
&& ToTime(Time[0]) < ToTime(15, 0, 0))
{
roundUp = chandyRemainder <= 0.25 ? chandyRounded + 0.25 :
chandyRemainder <= 0.5 ? chandyRounded + 0.5 :
chandyRemainder <= 0.75 ? chandyRounded + 0.75 :
chandyRounded +1;
EnterLongStopLimit(DefaultQuantity, roundUp, roundUp, "");
Alert("MyAlert0", Priority.High, "", "", 1, Color.White, Color.Black);
}
// Condition set 2
if (DefaultInput[0] > ChandelierSAR(5, 3.5).Chandelier[0]
&& ToTime(Time[0]) > ToTime(8, 30, 0)
&& ToTime(Time[0]) < ToTime(15, 0, 0))
{
roundDown = chandyRemainder >= 0.75 ? chandyRounded + 0.75 :
chandyRemainder >= 0.5 ? chandyRounded + 0.5 :
chandyRemainder >= 0.25 ? chandyRounded + 0.25 :
chandyRounded;
ExitLongStopLimit(roundDown, roundDown, "", "");
PlaySound(@"C:\Program Files\NinjaTrader 6.5\sounds\Alert2.wav");
}
// Condition set 3
if (ToTime(Time[0]) > ToTime(8, 30, 0)
&& ChandelierSAR(5, 3.5).Chandelier[0] < DefaultInput[0]
&& ToTime(Time[0]) < ToTime(8, 31, 0))
{
EnterLong(DefaultQuantity, "");
}
// Condition set 4
if (ToTime(Time[0]) >= ToTime(15, 01, 0))
{
ExitLong("", "");
}
}
#region Properties
[Description("")]
[Category("Parameters")]
public double ChandyRounded
{
get { return chandyRounded; }
set { chandyRounded = Math.Max(1, value); }
}
[Description("")]
[Category("Parameters")]
public double ChandyRemainder
{
get { return chandyRemainder; }
set { chandyRemainder = Math.Max(1, value); }
}
[Description("")]
[Category("Parameters")]
public double RoundUp
{
get { return roundUp; }
set { roundUp = Math.Max(1, value); }
}
[Description("")]
[Category("Parameters")]
public double RoundDown
{
get { return roundDown; }
set { roundDown = Math.Max(1, value); }
}
#endregion
}
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Strategy in NT7 DNW.
Collapse
X
-
Strategy in NT7 DNW.
Works fine in 6.5, and I checked the code breaking changes and can't see anything that would be causing the problem. Any thoughts?
Code:Tags: None
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
344 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
557 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment