Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Gross profit / net profit plot ?

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

    Gross profit / net profit plot ?

    Anyone have a good starting point to plotting the Net gain or Gross profit.. please point me in that direction. Thanks

    #2
    Hello Dudley,

    You can find samples of accessing those values here:

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    To plot a value you can use either AddPlot or also drawing tools to display a value on the chart.


    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    Comment


      #3
      Click image for larger version

Name:	image.png
Views:	119
Size:	108.0 KB
ID:	1342108​i assume the Plot]0]= is the syntax but i have no line even with current code.

      i would like a graphic representation of :

      NetGain=SystemPerformance.AllTrades.TradesPerforma nce.Currency.CumProfit

      please advise with this simple indicator TY.

      Comment


        #4
        I also have this code to start from that uses ATM strategy,
        Click image for larger version

Name:	image.png
Views:	124
Size:	149.0 KB
ID:	1342110​But again i cannot get a visual plot even though i have created the ATM Strategy.. it seems to buy and sell just no plot PLEASE help.

        Comment


          #5
          The way I usually do it, I have my property setting as such:
          [Browsable(false)]
          [XmlIgnore]
          public Series<double> OvernightHigh
          {
          get { return Values[0]; }
          }​

          In OnState.Configure I am adding the plot like so:
          AddPlot(new Stroke(HighColor, DashStyleHelper.Dot, 3), PlotStyle.Line, "OvernightHigh"); // Plots[0]

          In OnBarUpdate, I am using the following:.
          OvernightHigh[0] = overnightHigh; // overnightHigh is a double that is keeping track of the price level.

          Notice that the OvernightHigh in properties is the same OvernightHigh[0] from OnBarUpdate.
          I am using Values[0] in the properties because that is the first Plot I have added in OnState.Configure, which is why I have also commented Plots[0] next to it, to keep track.
          If I were to add another plot, I would make sure that one has Values[1] in the properties.

          Let me know if that helps you.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          87 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          128 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          65 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by cmoran13, 04-16-2026, 01:02 PM
          0 responses
          117 views
          0 likes
          Last Post cmoran13  
          Started by PaulMohn, 04-10-2026, 11:11 AM
          0 responses
          67 views
          0 likes
          Last Post PaulMohn  
          Working...
          X