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

trouble modifying EmailTrades.zip indicator to include pnl metrics

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

    trouble modifying EmailTrades.zip indicator to include pnl metrics

    Hello,
    I am modifying the existing EmailTrades indicator found here in the library to also include current daily trade performance information in the email. So what I would like to have happen is when an order is filled it sends the standard email saying , Just filled a trade long xyz at a price but also include, Todays total realized gains are X , todays total unrealized gains are Y.

    The first part works, I do have the trade information successfully being emailed out but how can I use GetAtmStrategyUniqueId() and GetAtmStrategyRealizedProfitLoss() data on a trade that was already taken using ATM strategy? Note this is discretionary trading, nothing automated. It's not clear to me how can i still reference the ID of a trade that I manually took off of chart trader?


    Thanks,
    Evan
    Last edited by slocumtrader; 04-22-2013, 09:33 AM.

    #2
    Hello slocumtrader,

    Thanks for your note.

    Something like this is not currently possible. Using supported code, a strategy is only able to reference an ATM strategy by ID that has been added to the strategy.

    I think this is a good idea, and I am going to submit this idea to our development department.
    I will update you when I received a tracking ID for this request.

    Thank you for your suggestion to improve NinjaTrader. Your contributions will be considered for a future release of NinjaTrader.


    If you would still like to look into this, I recommend you post in the Undocumented/Unsupported thread. Other users may have tried something similar and may be able to help.
    http://ninjatrader.com/support/forum...ad.php?t=22435


    Let me know if I can be of any other assistance.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      trouble modifying EmailTrades.zip indicator to include pnl metrics

      Hi ChelseaB,

      Thanks for the response. One more question, is there any way I can check against having a position open at any given time?

      So to give an example, within the emailTrade indicator, I have it sending out "long xyz... etc" but half the time it isn't actually a long entry it is me covering a short, so i would like to introduce some simple logic that says, if (openPosition = true) then message displays covering short, otherwise display Entering long.

      Is this possible using any of the account/position variables?

      Thanks,
      Evan

      Comment


        #4
        Hello Evan,

        Thanks for your response.

        Yes, you can check the overall account position.
        The code for this looks like:

        Cbi.Position myPosition = Account.Positions.FindByInstrument(Instrument);
        if (myPosition != null)
        {
        // There is a position
        Print( myPosition.MarketPosition.ToString() + " - " + myPosition.Quantity.ToString() );
        }


        Below is a link to a thread that discusses this.
        http://www.ninjatrader.com/support/f...ad.php?t=42770


        Please let me know if this does not resolve your inquiry.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          trouble modifying EmailTrades.zip indicator to include pnl metrics

          Hi Chelsea,

          Thanks for the fast response. Before I go digging deeper on this error I am seeing I was wondering if you knew how to resolve offhand.

          It doesn't seem to like this line:

          Cbi.Position myPosition = Account.Positions.FindByInstrument(e.Execution.Ins trument);

          compile error saying: An object reference is required for the non-static field, method, or property "Ninjatrader.cbi.Account.Positions.get"

          Thanks!

          Comment


            #6
            Hi slocumtrader,

            The only way I have seen this work is by using the word "Instrument" as is, as the overload to the FindByInstrument method call.

            I'm not aware of any other way to get that to work.

            This is also unsupported code so I will not be able to provide you with any more information on it.
            Last edited by NinjaTrader_ChelseaB; 04-23-2013, 02:13 PM.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hi slocumtrader,

              I wanted to let you know that I have received a tracking ID regarding your feature request to access the profit and loss and other information of ATM strategies not running from this script.

              You request is being tracked with ID #1843. Thank you again for your suggestion to improve NinjaTrader. Your suggestion will be considered for a future release of Ninjatrader.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by alifarahani, Today, 09:40 AM
              6 responses
              36 views
              0 likes
              Last Post alifarahani  
              Started by Waxavi, Today, 02:10 AM
              1 response
              17 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by Kaledus, Today, 01:29 PM
              5 responses
              14 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by Waxavi, Today, 02:00 AM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_LuisH  
              Started by gentlebenthebear, Today, 01:30 AM
              3 responses
              17 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Working...
              X