NexusFi: Find Your Edge


Home Menu

 





Click => Sender


Discussion in NinjaTrader

Updated
    1. trending_up 1,212 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Click => Sender

  #1 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 132 since Oct 2010
Thanks Given: 27
Thanks Received: 350

Hello,

I have an indicator with a click event defined on the ChartControl:

 
Code
ChartControl.ChartPanel.MouseUp += new MouseEventHandler(myMouseEvents);

private void myMouseEvents(object sender, MouseEventArgs e)
{
    TriggerCustomEvent(new CustomEvent(myCustomEvent), e);
}
Does anybody know if there is a possibility to find out if the click happened in the main chart window or if it happened in a sub-panel? I am able to get the x y coordinates of the click and also the size of the ChartPanel but i didnt found a possibility to find out how many sub panels are present.

Thank you,
mike

I never lose. I either win or learn.
Nelson Mandela

The Potion | Konje | Pride | Stick Season
Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
MC PL editor upgrade
MultiCharts
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


Did you try in checking with the parent object of sender?
I have a similar indicator but I only used it with a single panel, I'll take a look if it's possible when I have a minute.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 132 since Oct 2010
Thanks Given: 27
Thanks Received: 350


sam028 View Post
Did you try in checking with the parent object of sender?
I have a similar indicator but I only used it with a single panel, I'll take a look if it's possible when I have a minute.

hey sam,

thank you for your reply.
no i didnt check if the parent is available in this context.
will have a look at it!

thank you,
mike

I never lose. I either win or learn.
Nelson Mandela

The Potion | Konje | Pride | Stick Season
Started this thread Reply With Quote
  #5 (permalink)
 
mk77ch's Avatar
 mk77ch 
Switzerland
 
Experience: Advanced
Platform: NinjaTrader
Broker: Dorman
Trading: Currency Futures, ES
Posts: 132 since Oct 2010
Thanks Given: 27
Thanks Received: 350

i just found a simple solution by using the bounds form the Plot method.
so i simply check if e.Y is between the top and bottom bounds to find out if the click event was fired by the current panel.

cheers,
mike

I never lose. I either win or learn.
Nelson Mandela

The Potion | Konje | Pride | Stick Season
Started this thread Reply With Quote
  #6 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


mk77ch View Post
i just found a simple solution by using the bounds form the Plot method.
so i simply check if e.Y is between the top and bottom bounds to find out if the click event was fired by the current panel.

cheers,
mike

I assumed you already though about this solution and didn't used it as it was not the "cleanest" way to do it, but I was wrong . And if it works, let it be!

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote




Last Updated on August 11, 2016


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts