Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy freezing NT

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

    Strategy freezing NT

    The code below is a part of a strategy that I am currently developing. This is the only entry code i have wriiten so far, the remaing portion of this code only deals with managing dynamic target and stops and calculating variables.

    My problem is, if you notice below you will see that my entry code is commented out. If i were to uncomment this code and try to run it, my NT7 will freeze. Once i comment it out, it runs ok. I don't know why this is happening. I never had this problem before and it just started happening.

    Can someone please tell me what going on .
    Thanks

    if (Position.MarketPosition == MarketPosition.Flat)
    {
    if(Stest == 1
    && Low[0] < Risk(1).Risk2[0]
    && Skew == -1)
    {
    // EnterShort(DefaultQuantity, "NSE1");
    DrawVerticalLine("My vertical line" + CurrentBar, 0, Color.Blue);
    PrintWithTimeStamp("dxdddddddddddddddddddddddddddd dddd");

    }
    }

    #2
    trader413, how are you running this strategy? On a chart, in a backtest, or from the strategy tab? Could you please post the entire strategy or mail it to support at ninjatrader dot com (attn: Austin - ticket 509631) so I can test this out myself?
    AustinNinjaTrader Customer Service

    Comment


      #3
      I am running it on a chart. I dont want to post my full strategy on here and it reference several different indicator that you would have to have installed for the strat to work. Is there any other way of finding out why is it freezing whenever I have that entry code?

      Comment


        #4
        Simple entry codes should not be crashing NinjaTrader. Are there any errors in the logs (right-most tab of Control Center)?
        AustinNinjaTrader Customer Service

        Comment


          #5
          This is what I am seeing.

          7/1/2011 11:23:33 AM Strategy Enabling NinjaScript strategy 'Geronimo/b4c35654616843bd8bb4c5dda52cee78' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=AllEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositio ns ExitOnClose=True/ triggering 30 before close Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=True MaxRestarts=4 in 5 minutes

          Comment


            #6
            Thanks, so no errors then? Could you send me your trace file from My Documents/NinjaTrader 7/trace/trace.20110701.txt (or yesterday's, if that was when the error occurred)?
            AustinNinjaTrader Customer Service

            Comment


              #7
              Whenever I run that code NT freezes and I have to force close it via task management. So I am not sure if by me doing that, I also delete any unsaved error messages. Attach is the file. I dont understand, if I exclude that one line of code, everything works fine.
              Attached Files

              Comment


                #8
                trader413, thanks for the info. Please update your NinjaTrader installation (.4) to the latest version (.6) and then open up any script and re-compile it and let me know if that doesn't work.
                AustinNinjaTrader Customer Service

                Comment


                  #9
                  Now i cant log in. I am getting the below errors.

                  7/1/2011 1:02:32 PM Connection CQG: The value of the property 'type' cannot be parsed. The error is: Could not load type 'CQG.Trader.DataAccess.DataServer.IInstrumentParse rFactory' from assembly 'CQG.Trader.DataAccess'. (C:\Program File(LoginFailed)


                  and this on my second attempt

                  7/1/2011 1:04:10 PM Connection CQG: There only can be one CQG adapter running at any time(LoginFailed)

                  Comment


                    #10
                    Hi again, please follow Jason's instructions in this post - http://www.ninjatrader.com/support/f...44&postcount=2.
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      Ok i got connected but I am having the same problem. Below is some of the remaing code, everything everything else is just minor calculations between various indicators.


                      protected override void Initialize()
                      {

                      SetStopLoss("NSE1", CalculationMode.Ticks,12,false);
                      SetProfitTarget("NSE1", CalculationMode.Price, TP);

                      CalculateOnBarClose = true;
                      TraceOrders = true;


                      }


                      protected override void OnBarUpdate()
                      {

                      if (ToTime(Time[0]) < ToTime(2, 0, 0))
                      return ;
                      if (ToTime(Time[0]) > ToTime(16, 0, 0))
                      return;

                      if (Position.MarketPosition == MarketPosition.Flat)

                      {
                      SetProfitTarget("NSE1", CalculationMode.Price, TP);
                      }
                      while (Position.MarketPosition == MarketPosition.Short)
                      {
                      // Once the price is greater than entry price+50 ticks, set stop loss to breakeven
                      SetProfitTarget("NSE1", CalculationMode.Price, TP);
                      }



                      //
                      if (Position.MarketPosition == MarketPosition.Flat)
                      {
                      SetStopLoss("NSE1", CalculationMode.Price,sRiskNumber,false);

                      }
                      else while (Position.MarketPosition == MarketPosition.Short)
                      {
                      if(STPtest == true)
                      {

                      //if(Position.MarketPosition == MarketPosition.Short)
                      //{

                      SetStopLoss("NSE1", CalculationMode.Price,sRiskNumber,false);
                      //}
                      }
                      }

                      if (Position.MarketPosition == MarketPosition.Flat)
                      {
                      STPtest = true ;

                      }



                      if (Position.MarketPosition == MarketPosition.Flat)
                      {
                      if(Stest == 1
                      && Low[0] < PVP().PVPLine[0]
                      && Skew == -1)
                      {
                      EnterShort(DefaultQuantity, "NSE1");
                      DrawVerticalLine("My vertical line" + CurrentBar, 0, Color.Blue);
                      PrintWithTimeStamp("dxdddddddddddddddddddddddddddd dddd");

                      }
                      }

                      }

                      #region Properties
                      [Description("")]
                      [GridCategory("Parameters")]
                      public bool MyInput0
                      {
                      get { return myInput0; }
                      set { myInput0 = value; }
                      }
                      #endregion
                      }
                      }

                      Comment


                        #12
                        Hi there, at this point I'll need the full code to test this out to see what might be occurring. You can export it from File -> Utilities -> Export NinjaScript -> Select your strategy -> it will include all indicators necessary. You can then email it to us (attn: Austin - ticket 509631) and we'll keep it in strict confidentiality.
                        AustinNinjaTrader Customer Service

                        Comment


                          #13
                          Omg I am running into every problem today. I am getting an error whenever i try to export my strategy. Take a look at the thread below i am running into this problem when i try to export my strategy because this is one of the indicators it reference.

                          Last edited by trader413; 07-01-2011, 12:17 PM.

                          Comment


                            #14
                            Trader, can you just zip up your entire strategy and indicator folder and send me those? That should get around the export issue and give me all of the necessary indicators.

                            Another option would be for you to try and strip down your strategy as much as possible (remove the extra indicators) so that it still shows the crash, but doesn't need any non-standard indicators.
                            Last edited by NinjaTrader_Austin; 07-01-2011, 12:17 PM.
                            AustinNinjaTrader Customer Service

                            Comment


                              #15
                              The codes I post below is a striped down version of the strat. But never mind I fixed the problem I was having and i am going to mail the strat over to you.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              656 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              371 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              109 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              574 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              579 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X