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 CaptainJack, 05-29-2026, 05:09 AM
          0 responses
          53 views
          0 likes
          Last Post CaptainJack  
          Started by CaptainJack, 05-29-2026, 12:02 AM
          0 responses
          34 views
          0 likes
          Last Post CaptainJack  
          Started by charlesugo_1, 05-26-2026, 05:03 PM
          0 responses
          100 views
          0 likes
          Last Post charlesugo_1  
          Started by DannyP96, 05-18-2026, 02:38 PM
          1 response
          180 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 05-11-2026, 05:56 AM
          0 responses
          170 views
          0 likes
          Last Post CarlTrading  
          Working...
          X