Convert mouse x/y location to Time & Price - NinjaTrader Programming | futures io social day trading
futures io futures trading


Convert mouse x/y location to Time & Price
Updated: Views / Replies:3,107 / 8
Created: by YuvalW Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Convert mouse x/y location to Time & Price

  #1 (permalink)
Elite Member
USA
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 26 since Jul 2009
Thanks: 4 given, 17 received

Convert mouse x/y location to Time & Price

Hi all,

any idea of how can I convert mouse x/y location (on the chart panel) to Time/Price?

ChartControl has "GetTimeByX" method, this is internal method but I can try call it via reflection, but I don't see something for y/price conversion...

Thx for any help,

Yuval.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Elite Member
USA
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 26 since Jul 2009
Thanks: 4 given, 17 received


OK, got it:

 
Code
 
// Global vars.
private double priceMin;
private double priceMax;
private int boundsTop;
private int boundsHeight;
 
public override void Plot(Graphics graphics, Rectangle bounds, double min, double max) 
{
    priceMin = min;
    priceMax = max;
    boundsTop = bounds.Top;
    boundsHeight = bounds.Height;
 
    base.Plot(graphics, bounds, min, max);
}
 
private void chart_MouseClick(object sender, MouseEventArgs e)
{
    Panel chartPanel = sender as Panel;
    if (chartPanel == null)
        return;
 
    if (e.Clicks == 1)
    {
        double price = priceMax - (e.Y-boundsTop)*(priceMax-priceMin)/boundsHeight;
        Print(Instrument.MasterInstrument.Round2TickSize(price));
    }
}

Reply With Quote
The following 4 users say Thank You to YuvalW for this post:
 
  #4 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 285 received

x y conversion

Have you tested this with multiple charts on same panel?
I think you will run into some issues with this code.

Reply With Quote
 
  #5 (permalink)
Elite Member
USA
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 26 since Jul 2009
Thanks: 4 given, 17 received

No I have not.
Interesting... how the fib tools work on multiple charts? what values does it take? I'll check when I'll get back home..

Reply With Quote
 
  #6 (permalink)
Elite Member
Seattle WA/USA
 
Futures Experience: Intermediate
Platform: ThinkorSwim, NinjaTrader
Favorite Futures: Gold, Futures, Euro
 
Posts: 21 since Oct 2012
Thanks: 1 given, 9 received


YuvalW View Post
No I have not.
Interesting... how the fib tools work on multiple charts? what values does it take? I'll check when I'll get back home..

I know this is a very old post but I am looking for the same thing. On mouse click on a chart, I want to know the price where the click happened. I tried with the code posted here but that doesnt seem to work. Any ideas??

Reply With Quote
 
  #7 (permalink)
Elite Member
Seattle WA/USA
 
Futures Experience: Intermediate
Platform: ThinkorSwim, NinjaTrader
Favorite Futures: Gold, Futures, Euro
 
Posts: 21 since Oct 2012
Thanks: 1 given, 9 received


saikodi View Post
I know this is a very old post but I am looking for the same thing. On mouse click on a chart, I want to know the price where the click happened. I tried with the code posted here but that doesnt seem to work. Any ideas??

Never mind. Figured it out.

Reply With Quote
 
  #8 (permalink)
Elite Member
USA
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 26 since Jul 2009
Thanks: 4 given, 17 received


saikodi View Post
Never mind. Figured it out.

Hey,
Just saw it... Honestly I don't remember anything from this issue... Good you figured it... Lol

Reply With Quote
 
  #9 (permalink)
Elite Member
Seattle WA/USA
 
Futures Experience: Intermediate
Platform: ThinkorSwim, NinjaTrader
Favorite Futures: Gold, Futures, Euro
 
Posts: 21 since Oct 2012
Thanks: 1 given, 9 received


YuvalW View Post
Hey,
Just saw it... Honestly I don't remember anything from this issue... Good you figured it... Lol

Yeah it took a bit of searching around but finally got it. One great thing with forums is that you do get solutions and help if you need but there are many partial or incorrect postings that lead you the wrong way. And when something is incorrect / partial, generally there is no follow up to it. So you dont know why a particular approach does not work. :-)

Anyways, I am happy I get what I am looking for from this forum consistently.

Reply With Quote

Reply



futures io > > > > > Convert mouse x/y location to Time & Price

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Price marker at specific time meyer99 NinjaTrader 5 July 22nd, 2011 08:04 PM
Why High Gas Price Effects May Be Different This Time Quick Summary News and Current Events 0 April 13th, 2011 08:50 PM
$SPX 666 low squaring in price & time today? researcher247 Emini Index Futures Trading 3 February 16th, 2011 02:58 PM
Price and time projections Scalpguy The Elite Circle 4 August 21st, 2010 03:13 PM
Price & Volume Trading Journal ZTR Trading Journals 117 February 21st, 2010 04:02 AM


All times are GMT -4. The time now is 06:54 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-13 in 0.10 seconds with 19 queries on phoenix via your IP 54.90.92.204