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

SMA crossover using NT script

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

    SMA crossover using NT script

    I am having problem with Sma crossing. I use sma 20 and sma 4 and to get an alert when 4 crosses over 20 to show a green triangle and when 4 crosses below 20 for red triangle. I see it visually on the chart, but the triangles show up after the fact on all 4x instruments and when it sends email to me I don't which instrument was triggered.do I have to have nt script on each instrument for email to be specific. I have example of one of the charts attached.Click image for larger version

Name:	wrong sma crossovers on 4x instrument using NT strategy.JPG
Views:	1
Size:	62.4 KB
ID:	891870 Can some help??? I have tried it several times and the signal occurs but the triangles show several pips later. thanks in advance

    #2
    faithpips,

    Crosses can occur any time, but you can only place objects or anything like that on actual bars. The arrow pointing to it is the correct place for the cross.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Josh I am not sure I understand what ur saying but if u look at the chart posted the crossover is highlighted in yellow using NT sript, the triangles are showing after the cross and I just want to know how to fix it. thanks

      Comment


        #4
        The triangles are showing in the correct locations - the bar after the cross occurs. From your screenshot, most of the crosses occur between bars.

        Have a read of the help file about onbarupdate and calculateonbarclose: http://www.ninjatrader-support.com/H...dateEvent.html

        Comment


          #5
          Thanks decus, I have been away for a while. What I am trying to achieve is to get the cross over as it happens not after the fact. Waiting til the bar closes is too late.

          Comment


            #6
            Help!!!! Sma Crossovers

            How can I write this program on my strategy.
            I want an indicator on my chart when the opening bar is above both the 8 and the 20 SMA and vis versa.
            THANKS
            LAKAYANA

            Comment


              #7
              lakayana,

              I suggest you review the tutorial on how to make strategies with the Strategy Wizard here first: http://www.ninjatrader-support.com/H...tml?Overview34

              You want to just create yourself a Price vs Indicator condition. Please see this article for an idea: http://www.ninjatrader-support.com/H...ataComparisons
              Instead of doing price vs price, on one side just select an indicator instead.
              Josh P.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Brevo, Today, 01:45 AM
              0 responses
              6 views
              0 likes
              Last Post Brevo
              by Brevo
               
              Started by aussugardefender, Today, 01:07 AM
              0 responses
              3 views
              0 likes
              Last Post aussugardefender  
              Started by pvincent, 06-23-2022, 12:53 PM
              14 responses
              242 views
              0 likes
              Last Post Nyman
              by Nyman
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              9 responses
              384 views
              1 like
              Last Post Gavini
              by Gavini
               
              Started by oviejo, Today, 12:28 AM
              0 responses
              6 views
              0 likes
              Last Post oviejo
              by oviejo
               
              Working...
              X