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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    627 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    359 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    562 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    567 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X