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

Automatic Alert

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

    Automatic Alert

    Hello,i am looking for an automatic alert if three candles have an special formation with down/up High/low/Open/Close on candle close.

    But my programm isnt working right. so it doesnt shows all formations i wrote down in the script. and if the programm shows a signal, it stops but lovely it shoes all day long.

    I hope so much you can help me, this would be so great. (Sorry for my bad english)


    Attached Files

    #2
    Hello Vracupie,

    To understand why the condition is or is not evaluating as true, print the time of the bar and all values in the conditions.

    Below is a link to a forum post that demonstrates using prints to understand behavior.


    For example:

    if(Close[2] >= Open[2]){ //Long - short - long kerze
    if(Open[1] >= Close[1] && Close[2] >= Open[1] && High[1] > Close[2] && Close[2] > Close[1]){
    if(Close[0] >= Open[0] && Close[2] >= Open[0] && Close[2] >= Close[0] && High[0] > Close[2]){

    Print(string.Format("{0} | Close[2]: {1} >= Open[2]: {1} && Open[1]: {2} >= Close[1]: {3} && High[1]: {4} > Close[2]: {1} && Close[2]: {1} > Close[1]: {3} && Close[0]: {5} >= Open[0]: {6} && Close[2]: {1} >= Open[0]: {6} && Close[2]: {1} >= Close[0]: {5} && High[0]: {7} > Close[2]: {1}", Time[0], Close[2], Open[2], Open[1], Close[1], High[1], Close[0], Open[0], High[0]));

    What is the specific condition set that is not evaluating as true when you expect?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you very much! i will try it this way.

      Can you also say me how i set a soundfile on right place? This would be very helpfull for me.

      Thanks and best!
      ​​​​​​

      Comment


        #4
        So my main problem is: once the alert is triggerd, the programm stops. But i want this programm working all day long and to shows all signals of the day.

        how can i let start the loop every candle again?

        Comment


          #5
          Hello Vracupie,

          Below is an example of playing a sound file. I used the Strategy Builder to generate this line.
          PlaySound(@"C:\Program Files (x86)\NinjaTrader 8\sounds\Alert1.wav");

          When you mention: "the programm stops", do you mean the script is disabled with an error message on the Log tab of the Control Center?

          If not, the logic itself would control if those lines of code are evaluated. What is the output from the prints that show why the condition is true or false?
          Chelsea B.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by usazencort, Today, 01:16 AM
          0 responses
          1 view
          0 likes
          Last Post usazencort  
          Started by kaywai, 09-01-2023, 08:44 PM
          5 responses
          602 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by xiinteractive, 04-09-2024, 08:08 AM
          6 responses
          22 views
          0 likes
          Last Post xiinteractive  
          Started by Pattontje, Yesterday, 02:10 PM
          2 responses
          20 views
          0 likes
          Last Post Pattontje  
          Started by flybuzz, 04-21-2024, 04:07 PM
          17 responses
          230 views
          0 likes
          Last Post TradingLoss  
          Working...
          X