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:	88
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:	92
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 NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X