Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

EMA cross Question

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

    #16
    Originally posted by NinjaTrader_Josh View Post
    r2kTrader,

    It is absolutely intrabar. You have a signal bar. You see the cross on the signal bar. The signal bar evaluates your condition to true. Next tradeable location is the open of the next bar because you are using CalculateOnBarClose = true and as such the order goes in on the next bar.
    Exactly, but it is not working according to your logic.

    Today for example, I have it set to COBC set to False (testing) and it executed the order 3 (or maybe 2, depending on how you count) bars later. I'm running in real time using Zen w/Mirus.

    Again, I am only using the sample SMA cross to test at the moment.



    Remaining patient,


    r2kTrader

    Comment


      #17
      Describe your complete and exact setup. Describe exactly what you see and every parameter setting you have used. Please post all evidence you feel supports your case.

      I assure you with SampleMACrossOver and CalculateOnBarClose = false, when a cross is recognized from one bar to the other a trade will be submitted immediately.
      Josh P.NinjaTrader Customer Service

      Comment


        #18
        Originally posted by NinjaTrader_Josh View Post
        Describe your complete and exact setup. Describe exactly what you see and every parameter setting you have used. Please post all evidence you feel supports your case.

        I assure you with SampleMACrossOver and CalculateOnBarClose = false, when a cross is recognized from one bar to the other a trade will be submitted immediately.
        Josh,

        Thanks for your help on this. I still don't understand why my chart looks right and I can see the crossover (with CalcOnBrClse = 1), but the trade doesn't fire for a whole other bar. I will play with this more and try to narrow my focus before asking more questions about this.

        Right now I am trying to get Ninja installed, but wanted to drop back in and say thanks. (And to you as well Bertrand)

        --UPDATE--
        Josh,

        I was just reading the release notes for .10, this caught my eye:

        Fixed

        2634

        NinjaScript

        Strategies did not trigger live trades if WaitUntilFlat == true && CalculateOnBarClose == false && (TIF == Day || ExitOnClose == true)

        Sounds VERY close to my situation ;-)
        Last edited by r2kTrader; 05-10-2009, 09:41 PM. Reason: Reviewed Release Notes for .10

        Comment


          #19
          Thanks for the kind words and update r2kTrader, please let us know how it goes for you on the most recent update.

          Comment


            #20
            Dear Support,

            This is under my initialize.

            Add(PeriodType.Minute, timePeriod);

            //Show SMA
            SMA(BarsArray[1], Fast).Plots[0].Pen.Color = Color.Green;
            SMA(BarsArray[
            1], Slow).Plots[0].Pen.Color = Color.Orange;
            Add(SMA(BarsArray[
            1], Fast));
            Add(SMA(BarsArray[
            1], Slow));

            I am not seeing this plot when I add the strategy to the chart.

            1. Is my problem because I have the plots in my initialize with BarsArray? (not getting an error, just can't see plots)

            2. Can I plot BarsArray 1 on top of chart's default bars? In other words, if barsarray 1 is based on 4 min, can it draw the line on a chart that defaults to 5m?


            Thank you,

            Comment


              #21
              1. Correct. BarsArray does not exist in Initialize().

              2. You will want to see this reference sample if you are trying to do multi-series plotting. http://www.ninjatrader-support2.com/...ead.php?t=6651
              This is provided as an as-is solution. It has its limitations. Multi-series charting will be available in NT7.
              Josh P.NinjaTrader Customer Service

              Comment


                #22
                Josh,

                Just wanted to update this thread with some findings. First, let me set the premise.

                I had the basic SMA cross strategy (sample strategy) running for testing.

                I then had a chart up so I could see when it crossed visually.

                I could not figure out why it was not firing a trade when on the chart it was clearly crossing.

                We explored the obvious, Calc on bar close, etc., but one area we DID not explore was the Session Time. If I set my Session Time in my strategy to 8am-4pm, and then open a chart that defaults to 12am-12am, then what I see on my chart verses when the strategy sees a cross, will be substantially different. Then compound this issue further when you are "adding" instruments underneath (see other posts about hard coding strategy variables/parameters for those who are not aware of what I am talking about).

                So, I just wanted to come back and suggest that one of the things to look at on the checklist is the actual Session Time on the Chart, verses the Session Time set for the strategy.

                I hope this helps others who may be experiencing similar issues.

                My suggestion when asking about your strategy reacting in sync with what you expect from your strategy is to make absolutely sure that EVERYTHING you are looking at is on the same Session Time. This might save everyone a lot of pain ;-0

                Comment


                  #23
                  That is correct. One easy way to ensure sessions are the same is just to throw the strategy onto the chart directly instead of loading the strategy in the Strategies tab. When a strategy is loaded from the chart it will use the chart's session.

                  For people who do not know how to do this: http://www.ninjatrader-support.com/H...romAChart.html
                  Josh P.NinjaTrader Customer Service

                  Comment


                    #24
                    Originally posted by NinjaTrader_Josh View Post
                    That is correct. One easy way to ensure sessions are the same is just to throw the strategy onto the chart directly instead of loading the strategy in the Strategies tab. When a strategy is loaded from the chart it will use the chart's session.

                    For people who do not know how to do this: http://www.ninjatrader-support.com/H...romAChart.html
                    The only problem with this is when you do ANYTHING that affects the chart, you blow up your strategy. So if you are running live, tying the strategy to the chart can be volatile. From the strategy tab, it's more of a service running in the background and less prone to accidental mishaps do to reloading historical data or the like. It's never fun to deal with re-syncing a strategy to the brokerage account

                    Running off the chart is not my personal preference, but others might find my concerns not to be an issue.

                    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
                    573 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    575 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X