NexusFi: Find Your Edge


Home Menu

 





I could use a hand with some code please.


Discussion in NinjaTrader

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




 
Search this Thread

I could use a hand with some code please.

  #1 (permalink)
 
KennyK's Avatar
 KennyK 
Sunshine Coast Queensland Australia
 
Experience: Intermediate
Platform: Ninja Trader, DT7.
Broker: Ninjatrader
Trading: AUD Futures
Posts: 95 since Apr 2013
Thanks Given: 29
Thanks Received: 24

HI,
I could use a hand with some code please.
I need to know how to click on either the high or low of a bar, (let's say the low of a bar for this example), we'll call this low "point A", and capture the price, then click on a the high or low of a second bar, (for this example a high), which we'll call "point B", and capture this price as well as well as the bar count from "point A" to "point B".
The 2 prices I would store in variables, the bar count would also go to a variable.
I would also with the same 2 clicks like to draw a Gann Fan on the chart using the speed of the range clicked on using a calculation involving the price and time value stored in the variables.

I am not sure where the click would have to be? Either on the bar either above or below the mid point?
Or above the high and below the low? Or perhaps something else?

Not sure if any of the native Gann Fan methods when called actually draw a Gann fan that looks the same as the one in the drawing tools and automatically has the same adjustable properties and parameters show in the indi properties window? But would like to know.

P.S. I have just done a C# coding course and have successfully coded two indicators so far.
I have found coding windows programs in Visual Studio much easier than coding indicators in NT7.
Mainly because all the learning was coding windows programs in Visual Studio, so I am reasonably familiar with that stuff. But Not so familiar with what's what in Ninja Script.

I'd really appreciate some guidance.

Cheers,
Ken.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
 
  #3 (permalink)
 Jaba 
Austin TX
 
Experience: Intermediate
Platform: SaintGobain Crystal Ball
Trading: NQ
Posts: 81 since Oct 2010
Thanks Given: 103
Thanks Received: 134



KennyK View Post
HI,
I could use a hand with some code please.
I need to know how to click on either the high or low of a bar, (let's say the low of a bar for this example), we'll call this low "point A", and capture the price, then click on a the high or low of a second bar, (for this example a high), which we'll call "point B", and capture this price as well as well as the bar count from "point A" to "point B".
The 2 prices I would store in variables, the bar count would also go to a variable.
I would also with the same 2 clicks like to draw a Gann Fan on the chart using the speed of the range clicked on using a calculation involving the price and time value stored in the variables.

I am not sure where the click would have to be? Either on the bar either above or below the mid point?
Or above the high and below the low? Or perhaps something else?

Not sure if any of the native Gann Fan methods when called actually draw a Gann fan that looks the same as the one in the drawing tools and automatically has the same adjustable properties and parameters show in the indi properties window? But would like to know.

P.S. I have just done a C# coding course and have successfully coded two indicators so far.
I have found coding windows programs in Visual Studio much easier than coding indicators in NT7.
Mainly because all the learning was coding windows programs in Visual Studio, so I am reasonably familiar with that stuff. But Not so familiar with what's what in Ninja Script.

I'd really appreciate some guidance.

Cheers,
Ken.

since ChartPanel has a MouseClick event you can subscribe to that:

 
Code
        protected override void OnStartUp()
        {
            // remove previous handler
            this.ChartControl.ChartPanel.MouseClick -= ChartControl_MouseClick;
            // add a new handler
            this.ChartControl.ChartPanel.MouseClick += new System.Windows.Forms.MouseEventHandler(ChartControl_MouseClick);
        }

        // the handler
        void ChartControl_MouseClick(object sender, MouseEventArgs e)
        {
            Print("mouse x: " +e.X +", y: " +e.Y);
        }
No sure about GannFann... maybe somebody else can answer that
J

Reply With Quote
Thanked by:




Last Updated on August 13, 2014


© 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