Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

2-Line Alarm Strategy

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

    2-Line Alarm Strategy

    This programs compiles fine. Sound files work fine outside of program, Set Minimum bar to 1, but does not out put to Log File or Output Window nor does it sound with Speakers on. Prc Variable is well below instrument testing.

    Running on real-time feed from IB.

    protected override void OnBarUpdate()
    {
    // Condition set 1
    Print("Value Checking: " + CurrentBar + " Close: " + Close[0] + " Prc: " + Prc);
    if (Close[0] > Prc)
    {
    Print("Value Checking: " + CurrentBar + " Close: " + Close[0] + " Prc: " + Prc);
    Alert("MyAlert0", Priority.High, "", @"C:\Program Files\NinjaTrader 7\sounds\AlertPrice.wav",2, Color.White, Color.Black);
    PlaySound("AlertSound2.wav");
    PlaySound(@"C:\Program Files\NinjaTrader 7\sounds\AlertRSI.wav");
    PlaySound("AlertATR.wav");
    Print("The Program is working");
    Print(Close[0].ToString("0.00"));
    Log("Action Took Place",NinjaTrader.Cbi.LogLevel.Information);
    }
    }

    #2
    Hi adlane,

    Thanks for the post and welcome to the NT forums.

    If you see no output at all, then maybe the strategy isn't enabled? There is a print statement outside the condition check which should print for each bar. Make sure the strategy is enabled through the right click > Strategies screen.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Worked!

      Thanks! I have toggled a lot indicators to "Enabled" in there Right-Side Pane Parameter Window but just did not think of it for Strategies. Log, First Alert, Print all work now.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by argusthome, Yesterday, 10:06 AM
      0 responses
      17 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      16 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      14 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      9 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      36 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X