Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can a strategy take a screenshot when an order Is filled?

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

    Can a strategy take a screenshot when an order Is filled?

    Hi,

    I’m working on a Strategy and would like to take a chart screenshot automatically whenever a trade is executed — either Long or Short.

    As a reference, I used post #7 from the following thread:

    Specifically, I simplified the attached file MyScreenTaker.cs.

    When I apply the indicator directly to a chart, it works perfectly: the screenshot is saved to disk when I click the button, as expected.

    The problem starts when trying to integrate it with a Strategy:
    1. First, I copied the core screenshot logic directly into the Strategy, and tried executing it when an order is filled — nothing happened.
    2. Then, I tried referencing the working indicator (SmartChart) from the Strategy and calling its TriggerScreenshot() method.
      • The indicator is correctly added using AddChartIndicator().
      • The screenshot button even appears on the chart!
      • But pressing the button does nothing, and no screenshot is saved — not even when calling the method from code upon trade execution.
    So the question is:
    Is it possible or not to take a chart screenshot from a Strategy — either directly or through an attached Indicator — when a trade is filled?
    If not, what are the known limitations?

    Thanks in advance for any help or clarification!

    Fz

    #2
    Hello FaaZer,

    Attached is a modified version of an example that submits an order and then takes a screenshot.
    ChartScreenshotStrategyExampleModified_NT8.zip

    You could modify this further and take the screenshot from OnOrderUpdate() when an order.OrderState is OrderState.Filled.
    Attached Files
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    70 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    152 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X