Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DMI Cross Alert is no Working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    DMI Cross Alert is no Working

    I created a simple strategy that is supposed to alert me when DI+ and DI- cross but the script won't alert me either through email or sound. Where did I make mistakes?. I am pulling out of my hair , here is the code , many thanks :


    {
    /// <summary>
    /// Enter the description of your strategy here
    /// </summary>
    [Description("Enter the description of your strategy here")]
    public class DMICROSS : Strategy
    {
    #region Variables
    // Wizard generated variables
    private int aDEX = 1; // Default setting for ADEX
    // 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()
    {
    SetProfitTarget(0);

    CalculateOnBarClose = true;
    }

    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (DM(14).DiPlus[0] == DM(14).DiMinus[0]
    && ADX(14)[0] >= 15)
    {
    SendMail("[email protected]", "[email protected]", "DMI Cross", "DMI Cross");
    }
    }

    #region Properties
    [Description("")]
    [Category("Parameters")]
    public int DPLUS
    {
    get { return dPLUS; }
    set { dPLUS = Math.Max(-304, value); }
    }

    [Description("")]
    [Category("Parameters")]
    public int DMINUS
    {
    get { return dMINUS; }
    set { dMINUS = Math.Max(-324, value); }
    }

    [Description("")]
    [Category("Parameters")]
    public int ADEX
    {
    get { return aDEX; }
    set { aDEX = Math.Max(-178, value); }
    }
    #endregion
    }
    }
    Last edited by cowcool; 05-31-2009, 02:47 AM.

    #2
    hi

    hi there, i have a similar problem. have you resolved it? if yes i would appreciate if we can change ideas. thanks

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    65 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    149 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    99 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    286 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X