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 argusthome, 03-08-2026, 10:06 AM
    0 responses
    110 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    59 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    37 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    41 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    78 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X