I've been trying to setup a strategy using delta divergence on that would alert me and draw an arrow up/down when it occurs but no success. I should be simple but I'm not much of a programmer yet.
Basically when price closes below the open while the GomCD Noncumulative closes positive, I'd like an alert and/or draw an arrow at that bar.
I used the Strategy wizard with no success. I'll have not entered the alert code because I can do it later once i figure it out.
Any help would be appreciated.
Nick.
below is what I come up with so far
#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
{
///
/// Enter position when a Delta Divergence Occurs given CCI as filter
///
[Description("Enter position when a Delta Divergence Occurs given CCI as filter")]
public class DDScalp : Strategy
{
#region Variables
// Wizard generated variables
private int myInput0 = 1; // Default setting for MyInput0
// User defined variables (add any user defined variables below)
#endregion
///
/// This method is used to configure the strategy and is called once before any strategy method is called.
///
protected override void Initialize()
{
CalculateOnBarClose = false;
}
///
/// Called on each bar update event (incoming tick)
///
protected override void OnBarUpdate()
{
// Condition set 1
if (GomCD(GomCDCalculationModeType.BidAsk, GomCDChartType.NonCumulativeChart, GomFileFormat.Flat, GomFilterModeType.OnlyLargerThan, 1, false).DeltaValue[0] Open[0])
{
DrawArrowUp("My up arrow" + CurrentBar, false, 0, 0, Color.Lime);
}
// Condition set 2
if (GomCD(GomCDCalculationModeType.BidAsk, GomCDChartType.NonCumulativeChart, GomFileFormat.Flat, GomFilterModeType.OnlyLargerThan, 1, false).DeltaValue[0] > 0
&& Close[0]