Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CS0029 with EnterShortStop

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

    CS0029 with EnterShortStop

    IOrder entryOrder = EnterShortStop(1,entry);

    results in CS0029 - Cannot implicitly convert type void to NinjaTRader.Cbi.IOrder

    Other overloaded EnterShortStop methods work fine and return a IOrder Object (as documented).

    Version is 6.5.1000 (Live)

    #2
    Hi michaelbb,

    You will want to first do this in Variables:
    Code:
    private IOrder entryorder = null;
    Then in OnBarUpdate() where you want to place the order:
    Code:
    entryOrder = EnterShortStop(1, entry);
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Hi Josh,

      my code was to demonstrate the compiler error.

      Is your code compiled on your NinjaTrader version?

      On my version the EnterShortStop method is defined as:

      void EnterShortStop(int quantity, double stopPrice)

      It should be:

      IOrder EnterShortStop(int quantity, double stopPrice)

      Comment


        #4
        Hi michaelbb,

        I see what you mean now. Thanks for bringing this to our attention. I will get in contact with development.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        597 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
        555 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X