Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator event to SendKeys

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

    Indicator event to SendKeys

    I'm trying to create an indicator that will send keyboard key presses to screen capture an event on the chart.
    I have used a simple indicator " KeyReversalDown" to test. When I run the code in Sim, I don't get any screen saves.

    Any ideas?

    protected override void OnBarUpdate()
    {
    if (CurrentBar < Period + 1)
    return;

    Value.Set(High[0] > MAX(High, Period)[1] && Close[0] < Close[1] ? 1: 0);

    SendKeys.Send("^c"); ////////////////////////////

    }​

    Attached Files

    #2
    Hello Taddypole,

    The code you attached doesn't have sendkeys in it so if you are using that as is then its not going to send any keys. What key event are you trying to send? Keep in mind the send key event will be sent to the window not to your overall PC if that is a external screenshot program.

    Comment


      #3
      Sorry, I was trying to modify a protected indicator with the @ sign. Not allowed.
      I have updated the indicator with a copy that is modifiable. (KeyReversalDownRevA.cs)
      The indicator works to send the ctrl + c to the desktop and command Snagit to take a screen shot (which works) but then Snagit won't complete the process. I get a message that says "Failed to save file".

      I know this unsupported, but looking for any guidance anyone can provide.

      regards,
      taddypole...





      Attached Files

      Comment


        #4
        Hello Taddypole,

        If you are having a problem with the program snagit then you would need to review that programs help/support information. We wouldn't be able to tell you why that error happened in snagit or how to fix it.

        Comment


          #5
          I'm not sure why you would say i'm having a problem with Snagit. Everyday I use Snagit hot keys to take screen shots. I'm only trying to automate that process. I've never had a problem with Snagit. It's the automation i'm having problems with.

          Comment


            #6
            Hello Taddypole,

            You mentioned in your last post that snagit is having an error which Is why I said we aren't able to assist with that.


            The indicator works to send the ctrl + c to the desktop and command Snagit to take a screen shot (which works) but then Snagit won't complete the process. I get a message that says "Failed to save file".


            if the error is coming from that snagit then we won't be able to help.. If you are getting an error inside of NinjaTrader and NinjaTrader is reporting that error then that would be something our support could try to advise on.

            If snagit is throwing an error that it cannot save a file you would need to reach out to their support or review online help information for that tool to find out why that may be happening.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            579 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            334 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            101 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            554 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X