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

Plot exections plus gains/losses

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

    Plot exections plus gains/losses

    In a Strategy; TextAndMarker are plotted with entries, stop loss, profit target, etc.
    How can I also plot (DrawText?) along with the TextAndMarker the gains/losses for each trade ?

    #2
    Hello 2Look4me,

    Thank you for writing in. You could loop through the account.Executions object.
    For example:
    Code:
    foreach(Execution e in Account.Executions)
    {
    	DrawText(e.ExecutionId.ToString(), "Entry: " + e.Entry.ToString() + " & Exit: " + e.Exit.ToString(), CurrentBar - e.BarIndex, Low[CurrentBar - e.BarIndex] - 2 * TickSize, Color.Blue);
    }
    Please let me know if this is not what you are looking for or if I may be of further assistance.
    Michael M.NinjaTrader Quality Assurance

    Comment


      #3
      Hi Michael,

      I didn't find additional documentation to better understand your code, but in trying it, I get the text:"Entry:False & Exit:True" or "Entry:True & Exit:False"

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Brevo, Today, 01:45 AM
      0 responses
      2 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      3 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      238 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      384 views
      1 like
      Last Post Gavini
      by Gavini
       
      Started by oviejo, Today, 12:28 AM
      0 responses
      4 views
      0 likes
      Last Post oviejo
      by oviejo
       
      Working...
      X