Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Save chart as image from strategy?

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

    Save chart as image from strategy?

    In strategy, we can programatically setup a chart,
    add indicators and so on... such Chart is then visible in the Strategy analyzer / Chart.

    I would like to code a strategy, that will trade as usually, but also saves chart when needed (mostly when opening and closing trade).

    This is useful, so I do not have to manually search for each trade to check it - but strategy exports images with trades, which will be much faster to look at.

    Please guide me to some functions / examples, how can I save chart into image from strategy (by NinjaScript) during running backtest?

    Best regards
    M.
    Last edited by misova; 01-01-2018, 03:29 PM.

    #2
    Hello misova,

    I will follow up with you tomorrow.

    Thank you for your patience.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello misova,

      Thank you for your patience.

      Within a strategy, any indicators added with AddChartIndicator will appear on the chart displayed through the strategy analyzer. Outside of AddChartIndicator, there is no supported means to programatically set up a chart.

      See addchartindicator.


      Regarding a screen shot of the strategy analyzer chart at the time of each trade, I’m not sure of a supported means of accomplishing this, as the SA chart is populated with signals after the analyzer has run, not one by one such as if trading live. While you can take a screen shot of the chart in the SA, how you would programmicaly loop back through the chart and take screen shots of each entry would be difficult.

      A solution for what you’re looking to do could be to run your strategy in Market Replay on a chart, and use the logic in the attached strategy, which will take a screen shot when an entry trade is made.

      The sample will enter a long position, which when filled, will take a screen shot and save it to My Docs>NT8 Folder as MyScreenshot.png.

      Please see attached and let us know if you need further assistance.
      Attached Files
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        Alan, I really appreciate your support.
        Thank you for your help!

        I will test the code immediately in the morning.

        Best regards
        Misova

        Comment


          #5
          Alan,
          I tested it thoroughly and I can confirm it works really great.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by herzogvladimir2, Yesterday, 08:10 PM
          0 responses
          15 views
          0 likes
          Last Post herzogvladimir2  
          Started by giogio1, 04-13-2025, 01:42 AM
          2 responses
          40 views
          0 likes
          Last Post giogio1
          by giogio1
           
          Started by mmenigma, 01-23-2024, 09:37 AM
          1 response
          92 views
          0 likes
          Last Post Nin8aTrender  
          Started by wbayne333, 02-22-2021, 01:18 PM
          6 responses
          416 views
          0 likes
          Last Post Nin8aTrender  
          Started by gtheaded, 07-03-2020, 03:47 PM
          3 responses
          374 views
          0 likes
          Last Post Nin8aTrender  
          Working...
          X