Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with Simulation Engine

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

    Problems with Simulation Engine

    Hello,

    I've been writing strategies and having problems getting them to trigger any trades using the simulation engine. So I used the strategy wizard to create a strategy where I attempt to force the trade using a boolean variable set to true as default (code below). I'm connected to the simulated data feed, and I'm able to trade manually from the Control Center and from Chart Trader. In Chart Trader, I can manually execute the trades, but there's no data being plotted. I tried multiple time frames: tick, second, and minute. Nothing.

    Stuck. Need help.

    Thanks!

    -Ben


    Code:
     
     
    protected override void Initialize()
    {
    SetProfitTarget("", CalculationMode.Ticks, 2);
    SetStopLoss("", CalculationMode.Ticks, 2, false);
    CalculateOnBarClose = true;
    }
    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Condition set 1
    if (ForceTrade == true)
    {
    EnterLong(1, "");
    PrintWithTimeStamp("Trade triggered.");
    }
    }

    #2
    bbeville,

    When you attach this to a chart, are you setting the "Enabled" field to true?

    What color is your strategy listed as in the "Strategies" tab?
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi Adam,

      Yeah, it's enabled. Strategy shows green. Just doesn't seem to be getting any data.

      Even if I'm not running a strategy, if I pull up a new chart is should still be updating, correct? That suggests to me that the chart tool isn't getting any data either.

      Thanks.

      Ben

      Comment


        #4
        bbeville,

        On weekends it wouldn't be getting data depending on what instrument you are trading,. Most markets are closed on weekends. My understanding is you weren't getting historical trades showing up on your chart. If you aren't getting live trades currently it would be most likely because of no realtime data being received due to market closure or something like that.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Hi Adam,

          No. As I mentioned, this is using the simulated data connection. I'm not trying to use live data.

          I had this problem before a couple of months ago. You guys said there was something wrong with my code because it wasn't triggering any trades. I didn't do anything with it then, but here it is. Unless I'm missing something, the code doesn't get any simpler than this. It should be triggering a trade on every bar close no matter what.

          Thanks.

          -Ben
          Last edited by bbeville; 08-26-2012, 11:09 AM.

          Comment


            #6
            bbeville,

            Could you post some screenshots here?
            Adam P.NinjaTrader Customer Service

            Comment


              #7
              I connected to the simulated data feed and my charts are dead, by the superdom and market analyzer are updating.

              I even created a new ES 09-12 chart, and it's dead too.

              Bizarre - 4 charts are now working, VIN, VIF, FB, and DX 09-12.




              Originally posted by bbeville View Post
              Hi Adam,

              Yeah, it's enabled. Strategy shows green. Just doesn't seem to be getting any data.

              Even if I'm not running a strategy, if I pull up a new chart is should still be updating, correct? That suggests to me that the chart tool isn't getting any data either.

              Thanks.

              Ben

              Comment


                #8
                One thing to make sure of, is to set your Session Template to Default 24/7 so the chart can plot new incoming data.
                Adam P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_AdamP View Post
                  One thing to make sure of, is to set your Session Template to Default 24/7 so the chart can plot new incoming data.

                  Yup, I verified all 4 of those charts are set to Default 24/7.


                  The other ones (ES,6E) are set to CME ETH.

                  Comment


                    #10
                    Sledge,

                    That was also for bbeville. I am not sure why this is happening in your case. With default 24/7 set it should be fine. Have you tried a new workspace?
                    Adam P.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_AdamP View Post
                      Sledge,

                      That was also for bbeville. I am not sure why this is happening in your case. With default 24/7 set it should be fine. Have you tried a new workspace?

                      Oops - sorry, I wasn't clear.

                      I confirmed that the 4 charts that are working are 24/7 as you suggested.

                      The others that were not working, were not.

                      Comment


                        #12
                        Hi Adam,

                        I figured it out. Apparently I have to open a new workspace if I'm going to be working with simulated data, so I can't have simulated and live data in the same workspace... In hindsight, it actually makes a lot of sense that it wouldn't allow me to update a live chart with fake data. Now it works like a charm.

                        Thanks! I appreciate your assistance.

                        -Ben

                        Comment


                          #13
                          Originally posted by sledge View Post
                          Oops - sorry, I wasn't clear.

                          I confirmed that the 4 charts that are working are 24/7 as you suggested.

                          The others that were not working, were not.

                          Hi Sledge,

                          I'm curious. Try opening a new workspace with only simulated data. If my theory is correct, that should fix your problem??

                          -Ben

                          Comment


                            #14
                            Originally posted by bbeville View Post
                            Hi Sledge,

                            I'm curious. Try opening a new workspace with only simulated data. If my theory is correct, that should fix your problem??

                            -Ben
                            No.

                            24/7 session template is 24/7.

                            CME US Index ETH (extended hours) is sunday 6:00pm to friday 4:15 pm EST).

                            If I would start it now at 9:00 pm, more charts would work.

                            The Session Template assigned to the instrument (stock,index,future) works on simulated data.

                            Comment


                              #15
                              sledge -

                              This may not be an acceptable solution, but have you tried restarting Ninja?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              647 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              368 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
                              571 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