Firing a Custom Paint Event in NinjaTrader - NinjaTrader | futures io social day trading
futures io futures trading


Firing a Custom Paint Event in NinjaTrader
Updated: Views / Replies:667 / 6
Created: by Zeos6 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
 

Firing a Custom Paint Event in NinjaTrader

  #1 (permalink)
Elite Member
Toronto, Ontario, Canada
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts, TradeStation, E-Signal
Broker/Data: Amp Futures/CQG; TransAct Futures
Favorite Futures: Currency Futures, Commodities Futures, Bonds, Stocks, Indices
 
Posts: 16 since Jan 2011
Thanks: 0 given, 1 received

Firing a Custom Paint Event in NinjaTrader

Hi,

I have written a custom event in my indicator code. As part of this event, I need to repaint the various graphic objects drawn on the visible part of the chart, which I do via Refresh(). The repaint needs to be done regardless of whether the chart is connected to data from a provider.

Unfortunately, the chart is not being repainted. I believe the custom event is firing but is being consumed by the form. I can access the window of the chart and attach to its Paint event but this still does not work as there does not seem to be an equivalent to KeyPreview that relates to paint events.

This is unsupported by Ninja, but can someone please point me in the right direction so that I can achieve a chart repaint based on a custom paint event even when disconnected form a data provider? Any suggestions would be greatly appreciated. Thanks.

Reply With Quote
 
  #2 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,218 since Jun 2009
Thanks: 628 given, 6,315 received
Forum Reputation: Legendary


Zeos6 View Post
Hi,

I have written a custom event in my indicator code. As part of this event, I need to repaint the various graphic objects drawn on the visible part of the chart, which I do via Refresh(). The repaint needs to be done regardless of whether the chart is connected to data from a provider.

Unfortunately, the chart is not being repainted. I believe the custom event is firing but is being consumed by the form. I can access the window of the chart and attach to its Paint event but this still does not work as there does not seem to be an equivalent to KeyPreview that relates to paint events.

This is unsupported by Ninja, but can someone please point me in the right direction so that I can achieve a chart repaint based on a custom paint event even when disconnected form a data provider? Any suggestions would be greatly appreciated. Thanks.

as long as you know how many bar ago you can repaint it
http://www.ninjatrader.com/support/helpGuides/nt7/index.html?barcolorseries.htm

Reply With Quote
 
  #3 (permalink)
Elite Member
Toronto, Ontario, Canada
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts, TradeStation, E-Signal
Broker/Data: Amp Futures/CQG; TransAct Futures
Favorite Futures: Currency Futures, Commodities Futures, Bonds, Stocks, Indices
 
Posts: 16 since Jan 2011
Thanks: 0 given, 1 received


Thank you for the response but the reply misses the point of my question entirely. Perhaps it is the way I have written it. I simply need a way to fire a custom paint event when there is no incoming data, and the data feed is disconnected.

Reply With Quote
 
  #4 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

Answer
This post has been selected as an answer to the original posters question Answer


Zeos6 View Post
Thank you for the response but the reply misses the point of my question entirely. Perhaps it is the way I have written it. I simply need a way to fire a custom paint event when there is no incoming data, and the data feed is disconnected.

If you do plot override this method is fired every time something is drawn on the chart (eg. new bar, scrolling left or right, zoom in and out, etc.).

Take a look at g3ChartSpan where this is utilised in the simplest way.

Reply With Quote
 
  #5 (permalink)
Elite Member
Wrocław, Poland
 
Futures Experience: Intermediate
Platform: NinjaTrader, Racket
Favorite Futures: Ockham's razor
 
gregid's Avatar
 
Posts: 651 since Aug 2009
Thanks: 321 given, 605 received

In some circumstances you may also find the following useful:
 
Code
                this.ChartControl.ChartPanel.Invalidate();
                this.ChartControl.ChartPanel.Update();

Reply With Quote
 
  #6 (permalink)
Elite Member
Toronto, Ontario, Canada
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts, TradeStation, E-Signal
Broker/Data: Amp Futures/CQG; TransAct Futures
Favorite Futures: Currency Futures, Commodities Futures, Bonds, Stocks, Indices
 
Posts: 16 since Jan 2011
Thanks: 0 given, 1 received

Thank you. I generally tend to use this.ChartControl.Refresh() to get an immediate redraw.

Reply With Quote
 
  #7 (permalink)
Elite Member
Toronto, Ontario, Canada
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts, TradeStation, E-Signal
Broker/Data: Amp Futures/CQG; TransAct Futures
Favorite Futures: Currency Futures, Commodities Futures, Bonds, Stocks, Indices
 
Posts: 16 since Jan 2011
Thanks: 0 given, 1 received


gregid View Post
If you do plot override this method is fired every time something is drawn on the chart (eg. new bar, scrolling left or right, zoom in and out, etc.).

Take a look at g3ChartSpan where this is utilised in the simplest way.

Thank you. I had a look at the indicator (very nice), and it seems to have the behaviour I need. I need to fire this paint draw from a custom event, so I will work with this approach and see how it goes. Thank you.

Reply With Quote

Reply



futures io > > > > Firing a Custom Paint Event in NinjaTrader

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
Integrate your own custom App with NinjaTrader BMMA14 NinjaTrader 8 September 3rd, 2014 10:01 PM
Ninjatrader order event handler DoobyWho NinjaTrader Programming 8 August 5th, 2014 03:54 PM
Overriding Custom Event in Ninja spinnybobo The Elite Circle 1 March 11th, 2014 06:46 PM
Custom Instrument development for NinjaTrader IamDeveloper NinjaTrader Programming 1 September 26th, 2013 04:18 PM
Custom Time Event for a ATM jthom NinjaTrader Programming 5 May 18th, 2010 02:10 AM


All times are GMT -4. The time now is 06:51 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 33 queries on phoenix via your IP 54.90.92.204