Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Modified RSI Alert

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

    Modified RSI Alert

    I need assistance with an alert for a modified RSI. I want to create an alert that sets off when the RSI hits 70. When I use the stock RSI indicator of 14 periods, 3 smoothing, and I use this alert, then it works as expected:

    RSITarget = 70;
    PlayAlert = true;
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (RSI(14, 3).Avg[0] >= RSITarget
    && PlayAlert == true)
    {
    Alert("MyAlert3", Priority.High, "RSI > 70", @"C:\Program Files (x86)\NinjaTrader 7\sounds\Alert1.wav", 5, Color.White, Color.Black);
    }
    }


    Then, all works as expected. Now, when I use the RSI indicators of 7 periods, 3 smoothing, and I use this alert, it fails.

    RSIAlert = 70;
    TriggerAlarm = true;
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (RSI(7, 3).Avg[0] == RSIAlert
    && TriggerAlarm == true)
    {
    Alert("MyAlert0", Priority.High, "Set Up", @"C:\Program Files (x86)\NinjaTrader 7\sounds\Alert1.wav", 0, Color.White, Color.Black);
    }
    }


    Any notion of where my fault is? Thanks for your help.

    #2
    Your second condition is looking for when it is exactly 70, not greater than or equal to as the first condition.

    Try using >= for your second condition check

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Davidtowleii, Today, 12:15 AM
    0 responses
    1 view
    0 likes
    Last Post Davidtowleii  
    Started by guillembm, Yesterday, 11:25 AM
    2 responses
    9 views
    0 likes
    Last Post guillembm  
    Started by junkone, 04-21-2024, 07:17 AM
    9 responses
    68 views
    0 likes
    Last Post jeronymite  
    Started by trilliantrader, 04-18-2024, 08:16 AM
    4 responses
    20 views
    0 likes
    Last Post trilliantrader  
    Started by mgco4you, Yesterday, 09:46 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Working...
    X