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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        67 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        36 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        60 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        53 views
        0 likes
        Last Post CarlTrading  
        Working...
        X