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

Add mouse-over and click functionality? Handling windows events in indicator?

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

    #16
    Originally posted by koganam View Post
    Wait a minute. If you are using the c# draw methods to draw your object, then you have the graphics object.

    How are you drawing the object? code?
    I hadn't coded the image yet. I assume something like

    Code:
    graphics.DrawImage(...,...);
    in the Plot() would be enough, assuming I figure out where on the filesystem to load the jpg from.

    Comment


      #17
      Originally posted by adamus View Post
      I hadn't coded the image yet. I assume something like

      Code:
      graphics.DrawImage(...,...);
      in the Plot() would be enough, assuming I figure out where on the filesystem to load the jpg from.
      Treat those drawings like any other object. Declare and initialize them, then assign them. That way you know what the object is, and you can handle it as you please. Take a look at the CustomPlotSample.cs file to see how it is done.

      Comment


        #18
        Originally posted by koganam View Post
        Treat those drawings like any other object. Declare and initialize them, then assign them. That way you know what the object is, and you can handle it as you please. Take a look at the CustomPlotSample.cs file to see how it is done.
        But I don't get a reference to them when I call the graphics object, and it doesnt seem that I can declare and initialize anything helpful either for the graphics calls either. At least nothing that CustomPlotSample.cs demonstrates.

        AFAIK now I need a control or a sub-class of a control, because that is the only thing I can use to attach events to, but I dont have anything except the ChartControl.

        (The same theory applies to creating tooltips which you suggested earlier, it seems)

        Correct me if I'm wrong, please, but I'm sitting on lame duck here.

        In case there is an obvious solution that I am missing, could you state it in terms of

        Code:
        graphics.FillEllipse(brush, rectangle);
        rather than graphics.DrawImage() which I have abandoned to avoid requiring a file.

        [EDIT] Now that I'm thinking a bit more clearly thanks to some well-timed caffeine, I figured it would be simple to place a control on the chart instead of drawing an image or a circle, and then I won't have any problem attaching the tooltip / label pop-up.

        The question is, would a tiny button be OK in case I have to show 100 of these things on the chart in one plot?

        (Is this still sane? It comes from about 4 hours of googling)
        Last edited by adamus; 07-24-2013, 07:57 AM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by tsantospinto, 04-12-2024, 07:04 PM
        7 responses
        126 views
        0 likes
        Last Post aligator  
        Started by futtrader, 04-21-2024, 01:50 AM
        5 responses
        56 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Started by PeakTry, Today, 10:49 AM
        0 responses
        2 views
        0 likes
        Last Post PeakTry
        by PeakTry
         
        Started by llanqui, Today, 10:32 AM
        0 responses
        5 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by StockTrader88, 03-06-2021, 08:58 AM
        45 responses
        3,994 views
        3 likes
        Last Post johntraderuser2  
        Working...
        X