NexusFi: Find Your Edge


Home Menu

 





Chart enters strange scroll mode


Discussion in NinjaTrader

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




 
Search this Thread

Chart enters strange scroll mode

  #1 (permalink)
 MarpleTrading 
Nederland
 
Experience: Advanced
Platform: Sierra charts
Broker: IB/IQFeed
Trading: Crude
Posts: 66 since Nov 2012
Thanks Given: 18
Thanks Received: 40

Hi,

I have created an indicator that reacts to a mouse click in the chart.
When the chart is not scrolled back the indi works just fine.

However, when it is scrolled back the first time I click after the indi is loaded makes the chart enter a scroll mode where when I move the mouse the chart scrolls left or right in accordance with the mouse movement. I have to double click to leave this mode. After some clicking my indi "gets it" and works as supposed.

Does anyone know who to get rid of this phenomena?

Thanks:
 
Code
		protected override void OnStartUp()
		{
			if (!_found)
			{
				ClearOutputWindow();
				this.ChartControl.ChartPanel.MouseClick += new MouseEventHandler(chart_MouseClick);
				this.ChartControl.ChartPanel.KeyDown += new KeyEventHandler(chart_KeyDown);
				chartHelper = new ChartHelper (this.ChartControl, this.Bars, this.TickSize);
				_t = Instrument.MasterInstrument.TickSize;
				_found=true;
			}
		}

...
		private void chart_MouseClick(object sender, MouseEventArgs e)
		{
			Panel chartPanel = sender as Panel;
			
			if (chartPanel == null)
				return;
			
			if (e.Clicks == 1 && (e.Button == MouseButtons.Left))
			{
				clickedBar = chartHelper.ConvertXtoBarIdx(e.X);
				int barsAgo = Count -  clickedBar - 1;
				entryPrice = Open[barsAgo];
				if (TradeParametersForm() == DialogResult.Cancel) return;

				if (isLong) 
				{
					DrawArrowUp("Up"+ArrowCount++, barsAgo, Low[barsAgo] - 2 * _t, Color.Blue);
				}
				else
				{
					DrawArrowDown("Down"+ArrowCount++, barsAgo, High[barsAgo] + 2 * _t, Color.Magenta);
				}
					
				StartAnalysis();
			}	
		}

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
ZombieSqueeze
Platforms and Indicators
Deepmoney LLM
Elite Quantitative GenAI/LLM
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
GFIs1 1 DAX trade per day journal
18 thanks
The Program
18 thanks
  #3 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,371



MarpleTrading View Post
Hi,

I have created an indicator that reacts to a mouse click in the chart.
When the chart is not scrolled back the indi works just fine.

However, when it is scrolled back the first time I click after the indi is loaded makes the chart enter a scroll mode where when I move the mouse the chart scrolls left or right in accordance with the mouse movement. I have to double click to leave this mode. After some clicking my indi "gets it" and works as supposed.

Does anyone know who to get rid of this phenomena?

Thanks:

Is this behavior repeatable on demand, or is it occasional? I've seen this happen occasionally, but not very often, I just chucked it up to some kind of obscure NT bug. But, if you can get it to happen predictably, then it's worth looking into.

Reply With Quote
  #4 (permalink)
 MarpleTrading 
Nederland
 
Experience: Advanced
Platform: Sierra charts
Broker: IB/IQFeed
Trading: Crude
Posts: 66 since Nov 2012
Thanks Given: 18
Thanks Received: 40

It suddenly came (after adding some code that should not have any impact on the mouse or keyboard), but now it is reproducible.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
monpere's Avatar
 monpere 
Bala, PA, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus, IB
Trading: SPY, Oil, Euro
Posts: 1,854 since Jul 2010
Thanks Given: 300
Thanks Received: 3,371


MarpleTrading View Post
It suddenly came (after adding some code that should not have any impact on the mouse or keyboard), but now it is reproducible.

If it is reproducible, you should be able to pinpoint the culprit line(s) of code, by commenting them out, until you pinpoint the exact code.

Reply With Quote
Thanked by:
  #6 (permalink)
 MarpleTrading 
Nederland
 
Experience: Advanced
Platform: Sierra charts
Broker: IB/IQFeed
Trading: Crude
Posts: 66 since Nov 2012
Thanks Given: 18
Thanks Received: 40

Strange, but I think your first suggestion was true.

I took out all code and the behaviour was gone. I put it back bit by bit and now all code is there again, but the scroll mode didn't come back

Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on November 23, 2012


© 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