Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Creating custom trades

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

    Creating custom trades

    Hi. I'm trying to combine actual trades to make a custom trades collection following a certain logic (ie. take the entry of one trade, the exit of another, more), then use TradesPerformance to retrieve performance profile of this collection. Problem is that Trade's Entry and Exit fields (Execution interface) are read only.

    The line, for example --
    Code:
    myCustomTrade.Entry.Price = 20.05;
    -- results in Object reference not set to an instance of an object error.

    Then the line --
    Code:
    myCustomTrade.Entry = new Execution();
    -- does not compile,with the message Property or indexer 'NinjaTrader.Cbi.Trade.Entry' cannot be assigned to -- it is read only.

    Is there any whatsoever way to create a custom trade?

    Given that it IS possible to create a new trade object :
    Code:
    Trade myCustomTrade = new Trade();

    #2
    Hello digibob,

    Using a custom trade collection would be custom C# and is not documented as an intended use of NinjaScript in the NinjaTrader help guide.

    Below are a few links to forum posts that may give you some ideas for this custom code.
    https://ninjatrader.com/support/foru...407#post844407
    https://ninjatrader.com/support/foru...061#post839061
    https://ninjatrader.com/support/foru...93#post1091093

    This thread will remain open for any community members that have example undocumented code they would like to share.


    While it may be possible to make a new Trade object, I can say it will not be possible to create a new execution or order object. These will need to be actual orders or executions that come from OnOrderUpdate, OnExecutionUpdate, or directly from the Account object.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thank you for the reply. I will check out the links. Appreciate your kind help.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by condorhero, Today, 09:28 PM
      0 responses
      6 views
      0 likes
      Last Post condorhero  
      Started by MaraAnkh, Today, 08:44 PM
      0 responses
      8 views
      0 likes
      Last Post MaraAnkh  
      Started by wooofad, Today, 05:38 PM
      0 responses
      7 views
      0 likes
      Last Post wooofad
      by wooofad
       
      Started by caacapital, Today, 10:10 AM
      2 responses
      18 views
      0 likes
      Last Post caacapital  
      Started by DiverG20, Today, 10:23 AM
      0 responses
      25 views
      0 likes
      Last Post DiverG20  
      Working...
      X