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 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
    132 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
    118 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