Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Access to manual trades from an indicator

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

    Access to manual trades from an indicator

    Hello,

    I wonder if it is possible to access from an indicator to the trades made manually (not from a strategy,I am a discretionary trader).

    The idea is to access all the informations of the "Account Performance" tab from an indicator. I have seen in the documentation the object Performance. Can this object be used to get information about manual trades ?

    Thanks.

    #2
    Hello fpa75,

    Thank you for your post.

    Unfortunately, there is no method for accessing the positions outside the strategy. However, there are unsupported and undocumented means to this. The following is an example of how to use unsupported methods to access account positions:
    Code:
    foreach (Account acct in Cbi.Globals.Accounts)
    {
    if (acct.Positions != null)
    {
    PositionCollection positions = acct.Positions;
    foreach (Position pos in positions)
    {
    Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice);
    }
    }

    Comment


      #3
      Ok, your answer means no (your code seems to give opened positions in real time, which is not my question). We cannot access to historical manual trades from an indicator. Big disappointment.

      Another option would be to place manual trades from a strategy. Can this be easily done ? I mean, still using the UI to open trades, while they are recorded by a strategy ?

      Regards.
      Last edited by fpa75; 03-24-2014, 02:32 AM.

      Comment


        #4
        Hello fpa75,

        The following offers an example of using unsupported methods to create buttons for entry on a custom toolstrip, this should initialize the orders as submitted by the automated strategy. Unfortunately, there is no supported method to do this or pull the orders and positions from other Order Entry windows.

        Comment


          #5
          Thank you for this code. I will have a look at it and see if I can use it.

          Best regards.

          PS: I hope NT 8 will allow direct access to the list of manual trades without the trick of using a strategy. After all, the Account Performance tab is able to list them, why can't we do the same from an indicator ?...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by geddyisodin, Today, 05:20 AM
          3 responses
          20 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by lorem, Today, 09:18 AM
          1 response
          4 views
          0 likes
          Last Post lorem
          by lorem
           
          Started by bmartz, Today, 09:30 AM
          0 responses
          3 views
          0 likes
          Last Post bmartz
          by bmartz
           
          Started by GussJ, 03-04-2020, 03:11 PM
          14 responses
          3,245 views
          0 likes
          Last Post GussJ
          by GussJ
           
          Started by ArkansasClint, Today, 09:28 AM
          0 responses
          0 views
          0 likes
          Last Post ArkansasClint  
          Working...
          X