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 algospoke, Yesterday, 06:40 PM
          2 responses
          23 views
          0 likes
          Last Post algospoke  
          Started by ghoul, Today, 06:02 PM
          3 responses
          14 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by jeronymite, 04-12-2024, 04:26 PM
          3 responses
          45 views
          0 likes
          Last Post jeronymite  
          Started by Barry Milan, Yesterday, 10:35 PM
          7 responses
          21 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by AttiM, 02-14-2024, 05:20 PM
          10 responses
          181 views
          0 likes
          Last Post jeronymite  
          Working...
          X