Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

problem with (int) Psize

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

    problem with (int) Psize

    Hi,

    I have created a method wich calculates some position size algorithm.

    This method returns a value stored in a "double" variable.

    When I place this variable in the quantty parameter of an order, the programm compiles ok, but when I press F5 botton in the chart (with the strategy loaded), some big alarming messagebox with many lines of text shows up, nd the NT gets disconnected as soon as I close that window.

    This is what shows in the Log:

    23/09/2010 16:34:20 Default Unable to restore strategy 'NinjaTrader.Strategy.CJSUNMANAGEDBOXBE4' with ID '4781c8ab688a46fda68817cf4f3baa52'. Most likely this strategy no longer is supported by the custom assemblies.

    And this is my order:

    if (LngOrder1== null && SrtOrder1== null)
    {
    PositionSize();
    LngOrder1 = SubmitOrder(0,OrderAction.Buy, OrderType.Stop,(int)Psize,0,upper+(TickSize*offSet),"OCO_Initial","Initial_ L1");

    SrtOrder1 = SubmitOrder(0,OrderAction.Sell, OrderType.Stop,(int)Psize,0,lower-(TickSize*offSet),"OCO_Initial","Initial_S1");
    }
    }

    Thanks al ot in advance

    #2
    Sorry,

    The Tab meaasge a posted before is referint to some removed strategy wich I cancel yesterday. But the problem with the (nt) psize is still appearing.

    Thanks

    Comment


      #3
      I attach the whole text of the error window .
      Attached Files

      Comment


        #4
        Hello CJS,

        Would you please clarify what issue you're having? If it's related to casting your double as int, is it possible to change return type of your method to an integer?
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Problem solved.!!

          There should be some kind of exemption. I Have isolate it with a condition.

          Thanks a lot

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          596 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          343 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          556 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          554 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X