Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple moving average ea

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

    #16
    In reference to Post #13 (above):- How do I prevent the strategy from confusing "Historical Positions" with "Live Positions;" you suggest that I fix this by removing the strategy - then how shall I use the strategy once removed? I have tried deploying the strategy on a different instrument (one I've not used before) but the problem persists.

    Comment


      #17
      Hello Ziklag,

      Thanks for your reply.

      The strategy does not confuse historical with live, it simply processes your strategy according to how you wrote it, and when applied to historical data is will perform those historical trades up to the moment where live data is and is the last historical trade has not finished the strategy name will be yellow, once the last historical trade closes (based on your strategy exit conditions), the strategy color will turn green and live trades will occur.

      There are 3 ways to deal with this situation:
      1) Do nothing and wait until the strategy reaches the exit conditions which will close the last historical position and then the strategy will place live trades.
      2) Change the strategy Start-up behavior from "wait until flat" to something else, please see the help guide here: https://ninjatrader.com/support/help..._positions.htm
      3) Add a condition to your entry sets that will allow the strategy to "skip" historical data.

      The condition would be:
      left side: Misc>CurrentState
      Center: Equals
      Right side: Misc>state RealTime

      Note: By adding that condition to your strategy entry sets, there will be no historical trades show/performed. If you apply the strategy to the strategy analyzer, this would prevent the analyzer from performing the analysis (unless you first remove the conditions).

      Comment


        #18
        I need help, the strategy is all green but, still, not signalling. See attached.
        Attached Files

        Comment


          #19
          Hello Ziklag,

          Thanks for your reply.

          You need to set the "lookback" for the crossover to 1 instead of 0.

          Please change to 1 and retest.

          Comment


            #20
            I've just done that ..., no success.
            Attached Files

            Comment


              #21
              Hello Ziklag,

              Thanks for your reply.

              How are you testing your strategy?

              On a live chart?

              On a live chart but looking at historical data?

              In the Strategy Analyzer (historical data only)?

              On playback with Market replay data?

              Comment


                #22
                I am testing on a Live Chart ...

                Comment


                  #23
                  But SMA is arguably the simplest of trading strategies ..., it's just that I am completely new to this platform and coding as a whole. My question is why don't you support me with a step-by-step guide of what would work?

                  Comment


                    #24
                    Hello Ziklag,

                    Thanks for your reply.

                    We provide free online webinars, recorded webinars, the help guide and assistance by e-mail or on the support forums. I've already provided all of these to you.

                    Even though we typically do not provide step by step assistance, did you create the step by step strategy I posted for you to test with on post #15?

                    Please note that if you are using a live chart, keep in mind that the right edge bar is the only live bar and the bars to the left are historical. Historical trades are not made on tick by tick data rather they are made on the candle data of Open, High, Low or close. Historically the GetCurrentAsk and GetCurrentBid will be the close data of the bar. If you are looking at historical trades then i suggest that you use price low crossing below the SMA.

                    Comment


                      #25
                      In Post #15 you said: “In addition, you will need to create an int variable in the inputs and variables section, call it LongEntryBar (or whatever you like).” So …, this goes under ‘variables’ within the ‘Input and Variables’ section – am I right? What 'Default' value do I assign it and what do I consider in assigning it any value? See attached.
                      Attached Files

                      Comment


                        #26
                        Hello Ziklag,

                        Thanks for your reply.

                        Correct, you create variables on the input and variables page.

                        What default you assign a variable depends on its use, sorry I cannot be more definitive than that. In this specific case, you can leave it as 1 or set it to zero, it does not matter because eventually the variable is assigned a value.

                        Comment


                          #27
                          You have said typically you do not provide step by step support. Does this forum got freelance support vendors or is there somewhere I can turn to?

                          Comment


                            #28
                            Hello Ziklag,

                            Thanks for your reply.

                            We can provide a link to 3rd party programmers in the Ninjatrader Ecosystem that can provide programming services to create whatever you like if this is of interest.

                            Comment


                              #29
                              Yes, I asked for whereabouts of programming services ..., may have the link then - thanks.

                              Comment


                                #30
                                Hello Ziklag,

                                Thank you for your post.

                                You can search our list of NinjaScript consultants through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more:
                                You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third-party services for NinjaTrader, all pricing and support information will need to be obtained through the consultant.

                                The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem, LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

                                Let me know if I may be of further assistance.
                                Thomas C.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                648 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                369 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                108 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                572 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                573 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X