Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Submit a screenshot of the chart

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

    #16
    Hello punkiy2111,

    Are you certain that the path to the file is correct?

    Are you seeing any errors in the log of the control center when it sends?

    You can use whichever way works for you, Share is generally the most simple and supports a screenshot attachment as a file path.

    Please let me know if I may be of further assistance.

    I look forward to being of further assistance.

    Comment


      #17
      Everything works for me correctly. Now the only thing I want is to remove the "sendmail" line and leave only the "share" line but that contains the information for "sendmail"
      Can you tell me how the code would be to display the delivery time and the chart time frame when sending the mail?
      It will be the end of this indicator. Thank you very much
      --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      SendMail(toEmailAddress, "RED", "Relative sell " + Time[0].ToString() + " chart on " + BarsPeriod.Value.ToString() + " " + BarsPeriodType.Minute);

      to

      Share

      Comment


        #18
        Hello punkiy2111,

        When using Share you configure the email settings in the Tools -> Options menu under the share services section. https://ninjatrader.com/support/help...gShareServices

        The string you used for the message could still be used with the Share command, the rest of the email related part would go into the options menu. Share just uses the name of the share service when you call it and finds that service from the options menu to send a mail using that service.

        I look forward to being of further assistance.

        Comment


          #19
          Sorry I have tried to place the same instructions with share and it does not work.

          Comment


            #20
            Hello punkiy2111,

            When you say it does not work, what specifically is wrong? Are you seeing an error or what part is not working?

            Are you able to send the test email in the share service setup screen for the service you configured?

            I look forward to being of further assistance.

            Comment


              #21
              Jesse with sendmail does it to me correctly. What does not work with Share is the time and time frame of the chart

              Comment


                #22
                Hello punkiy2111,

                Unfortunately that does not help to answer the question.

                Are you seeing an error or what do you see as the problem specifically?

                You mentioned that it does not work with the time and timeframe, i dont see you included those in your code from above. Are you passing the time and timeframe as a string to Share?


                An updated sample showing how you used Share would likely be required here so we can see what may be happening.


                I look forward to being of further assistance.

                Comment


                  #23
                  Is it possible with the share command to show me the time when the event occurred and the timing of the chart?

                  Share("Email", "Example Image", @"C:\Users\nameofuser\Documents\NinjaTrader 8\testimage.png", new object[]{"[email protected]","test e-mail with image"});

                  I just need to know this. Thanks.

                  Comment


                    #24
                    Hello punkiy2111,

                    I would suggest to read the Share page documentation so you know the overloads it has and how it works. The short answer here is you need to replace "ExampleImage" with your own string.



                    Code:
                    Share(string serviceName, string [B]message[/B], string screenshotPath)
                    You are also using one of the more complicated overloads, you can remove the object part, the email address is determined by the Share Service you use in the service name from the above code. You don't enter your email into the code at all.

                    I look forward to being of further assistance.

                    Comment


                      #25
                      Thank you now I have a problem. When the event occurs and the screenshot is printed, it sends me the previous screenshot and not the current one, it is as if there was a delay, maybe the email sent it too fast ... any idea where the problem could be? Thanks.

                      Dispatcher.InvokeAsync(new Action(() =>
                      {
                      if (chart != null && takeShot == true)
                      {

                      RenderTargetBitmap screenCapture = chart.GetScreenshot(ShareScreenshotType.Chart);
                      outputFrame = BitmapFrame.Create(screenCapture);

                      if (screenCapture != null)
                      {
                      PngBitmapEncoder png = new PngBitmapEncoder();
                      png.Frames.Add(outputFrame);

                      using (Stream stream = File.Create(string.Format(@"{0}\{1}", Core.Globals.UserDataDir, "MyScreenshot.png")))
                      png.Save(stream);

                      Print("Screenshot saved to " + Core.Globals.UserDataDir);
                      takeShot = false;
                      }
                      }
                      }));

                      Comment


                        #26
                        Hello punkiy2111,

                        Where do you have the Share code in relation to what you provided? If its outside the Dispatcher that would be the outcome as you described. The Share command would need to go right after your print

                        Code:
                        Print("Screenshot saved to " + Core.Globals.UserDataDir);
                        Share(...)
                        I look forward to being of further assistance.

                        Comment


                          #27
                          Perfect Jesse, thank you very much, the problem has been solved thanks to your help. The only thing I can't get is that together with the screenshot it sends me the time when the event occurred and the timing of the chart. I can't get it to work with the "share" command I just need this. Thanks again.


                          SendMail(toEmailAddress, "SELL, "Possible Sell " + Time[0].ToString() + " chart " + BarsPeriod.Value.ToString() + " " + BarsPeriodType.Minute);

                          Comment


                            #28
                            Hello punkiy2111,

                            That is likely the dispatcher causing that, its going to be outside of the scripts context. You can solve that by making some variables before the dispatcher:

                            Code:
                            string myTime = Time[0].ToString();
                            string myBars = BarsPeriod.Value.ToString();
                            Dispatcher.InvokeAsync(new Action(() =>
                            {
                            
                            ...
                            
                            SendMail(toEmailAddress, "SELL, "Possible Sell " + myTime + " chart " + myBars + " " + BarsPeriodType.Minute);
                            The other option would be to wrap that in a trigger custom event:
                            Code:
                            TriggerCustomEvent(o =>
                            {
                                SendMail(toEmailAddress, "SELL, "Possible Sell " + Time[0].ToString() + " chart " + BarsPeriod.Value.ToString() + " " + BarsPeriodType.Minute);
                            });
                            I look forward to being of further assistance.

                            Comment


                              #29
                              EDIT:
                              Finally Jesse finally the time and the chart have arrived, the only fault I have is when I add the indicator and every time I click on "apply" he makes me a screenshot and sends it to me by mail, removing this fault from the indicator It works well. Thanks a lot.



                              Thanks Jesse I'll try it later. Now what happens to me is that when adding the indicator and in the indicator panel, click to mark the sending of the email, it automatically creates a screenshot and sends me an email, it only happens when I add it for the first time, then it works. well, there is something that can be changed in ninjascript so that adding the indicator does not do this,
                              Also when I press reload ninjascript F5

                              thank you very much for your help.
                              Last edited by punkiy2111; 10-06-2021, 02:40 PM.

                              Comment


                                #30
                                Good morning Jesse, can you imagine what part of the code is failing? thank you very much.

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                580 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