Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New to NT. Simple Strategy Does Not Work

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

    New to NT. Simple Strategy Does Not Work

    Am new to NT. I am trying a simple strategy (see attachment) to begin learning.
    As you can see I want to get a 'beep' when the #1 bar > #2 bar on a 50 period SMA. There are no trades to be made only a 'beep'. I cannot get any 'beeps' from strategy backtest nor do I get anything from the charts. When I first did this, I chose to have an email sent. I changed it to a 'beep' for testing.

    What am I doing wrong?

    Thank you,
    Duke
    Attached Files

    #2
    Duke,

    Audio alerts will only be processed in real-time, so you will not hear anything when backtesting.

    You will only hear this alert on the chart when it is enabled and at the moment that condition is true.

    I'd suggest using the Print function under 'Do the following' to print a statement to the Tools--> Output window.

    Then run your backtest and check this output window to ensure this condition has ever returned as true.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thank you Matthew

      Originally posted by NinjaTrader_Matthew View Post
      Duke,

      Audio alerts will only be processed in real-time, so you will not hear anything when backtesting.

      You will only hear this alert on the chart when it is enabled and at the moment that condition is true.

      I'd suggest using the Print function under 'Do the following' to print a statement to the Tools--> Output window.

      Then run your backtest and check this output window to ensure this condition has ever returned as true.
      Thank you Matthew...

      Comment


        #4
        Matthew

        Originally posted by dukeb View Post
        Thank you Matthew...
        I altered the strategy to print to the output window. Nothing happened when I ran backtest. Perhaps you could give it a try. As you can see it is very simple.
        I must be missing something here.
        Than you for your help.
        Duke

        Comment


          #5
          Please give this a try Duke, prints a visual drawing on the chart once your condition triggers. What did you backtest on btw? Do you have the data / resolution for it available through your provider?

          All the best,
          Attached Files
          BertrandNinjaTrader Customer Service

          Comment


            #6
            A big thanks...

            Originally posted by NinjaTrader_Bertrand View Post
            Please give this a try Duke, prints a visual drawing on the chart once your condition triggers. What did you backtest on btw? Do you have the data / resolution for it available through your provider?

            All the best,
            It works great. I have a question.
            New code "DrawDiamond("My diamond" + CurrentBar, false, 0, Low[0] + -2 * TickSize, Color.Red);"
            "My diamond" is a tag. How does one use this for other scripts?
            I backtested on the AUD/USD. I don't understand what you mean when you reference "data/resolution". I am not live. I use MB Trading datafeed.
            I looked up the parameters for DrawDiamond. The "y" value has been omitted. In your script and the example in the reference manual. The reference example uses 'True'. Exactly, what is the 'y' value for?

            I want to thank you again for your help.

            Duke


            Comment


              #7
              You are welcome - glad to hear this worked out for you.

              The tag is just internal to the script, to prevent malicious code from another interfering there's no external access to those.

              With resolution, I just meant which chart type and timeframe, so for example some connections dont have daily data access and customers dont realize it until they getting empty results in the backtest window for non availability of data.

              Y is just the Y Axis double value the object would be placed, so the price - the 'true' from the sample was probably the autoScale parameter.

              BertrandNinjaTrader Customer Service

              Comment


                #8
                Thank you Bertrand .... on another issue

                The diamond prints(yhanks to you). However the email does not work.
                My intent was to have an email sent when the SMA condition was met.
                I still get the diamond, but no email.

                if (SMA(50)[0] > SMA(50)[1])
                {
                DrawDiamond(
                "My diamond" + CurrentBar, false, 0, Low[0] + -2 * TickSize, Color.Blue);
                SendMail(
                "", "[email protected]", "test alert", "success");

                Can you bail me out again?
                Duke

                Comment


                  #9
                  Duke, if you go under Tools > Options > Misc and test your email setup - does this work out?
                  BertrandNinjaTrader Customer Service

                  Comment


                    #10
                    Thank you, Bertrand. Yes, I now receive emails.
                    Thanks to your support, I am moving forward nicely.
                    Best regards,
                    Duke

                    Comment


                      #11
                      Glad to hear, enjoy your weekend Duke.
                      BertrandNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by rbeckmann05, Yesterday, 06:48 PM
                      1 response
                      12 views
                      0 likes
                      Last Post bltdavid  
                      Started by llanqui, Today, 03:53 AM
                      0 responses
                      6 views
                      0 likes
                      Last Post llanqui
                      by llanqui
                       
                      Started by burtoninlondon, Today, 12:38 AM
                      0 responses
                      10 views
                      0 likes
                      Last Post burtoninlondon  
                      Started by AaronKoRn, Yesterday, 09:49 PM
                      0 responses
                      15 views
                      0 likes
                      Last Post AaronKoRn  
                      Started by carnitron, Yesterday, 08:42 PM
                      0 responses
                      11 views
                      0 likes
                      Last Post carnitron  
                      Working...
                      X