Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Alerts in Strategy Analyzer

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

    Alerts in Strategy Analyzer

    Hello,

    I am tryin to get an alert to show up in the alert window whenever SMA = 2 crosses above SMA = 6(I would really like this SMA to be SMA = 3 with a Displacement = 3 so any help on that would be great as well). I am trying to test this using a Daily chart and the Yahoo feed in the strategy analyzer to see all the alerts for whenever the SMA's have crossed in this past year. Does backtesting a strategy in the strategy analyzer populate the alerts window? I have looked through the help online and searched the forums and cannot find what I am doing wrong. I have posted the code below:

    protectedoverridevoid Initialize()
    {
    Add(SMA(
    2));
    Add(SMA(
    6));
    CalculateOnBarClose =
    true;
    }
    ///<summary>
    /// Called on each bar update event (incoming tick)
    ///</summary>
    protectedoverridevoid OnBarUpdate()
    {
    // Condition set 1
    if (CrossAbove(SMA(2), SMA(6), 1))
    {
    Alert(
    "MA UP", Priority.High, "SMA cross UP", "", 1, Color.White, Color.Black);
    }
    }

    Please let me know if more information is needed. Thanks in advance for your help!

    #2
    Welcome to our forums, Alerts would only work in realtime going forward - you could for example draw an arrow on your conditions or enter a trade with EnterLong() so you could easily which signals would be generated on the historical data set.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    154 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    74 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    125 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    79 views
    0 likes
    Last Post PaulMohn  
    Working...
    X