Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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.

        JesseNinjaTrader Customer Service

        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.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            19 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            45 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            180 views
            0 likes
            Last Post jeronymite  
            Working...
            X