NexusFi: Find Your Edge


Home Menu

 





Forcing recalculation/redraw of a NinjaTrader chart


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 wolf50us 
Sarasota + Florida/USA
 
Experience: Advanced
Platform: Ninja,tradestation,metatrader
Trading: Futures eminis
Posts: 6 since Sep 2014
Thanks Given: 2
Thanks Received: 0

I have an indicator that plots volume histograms from the session start time similar to dValueArea.

My indicator additionally allows sub session volume histograms to be triggered and displayed
within the session. I have done this by setting a boolean flag for a secondary session and
specifying a time stamp which specifies the time (bar) at which to start the sub session histogram.

By selecting the indicator's properties panel and setting the flag and time stamp and applying the changes
the chart will be redrawn with the child histograms in the specified places.

All of this works fine when using the indicator's property panel and applying the changes. My problem
is that I have added a simple toolstrip button to do the same thing. The button sets the boolean flag
and captures the desired bar.

My problem is that, unlike applying changes from the indicator's properties panel which apparently re-initializes
and redraws the chart, I get no changes when using the toolstrip button.

I have tried calling ChartControl.ChartPanel.Invalidate() and ChartControl.Refresh() from OnMarketUptate()
and within the button click routine to no avail.

I would greatly appreciate any advice that sheds light on the sequence of events that are triggered
when an indicator's properties are changed and how to initiate those changes programmatically.

Thanks in advance and I apologize if I am posting a redundant thread. I have not found the answer yet.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Update May 8: Still Reviewing MOU, Demands Reparati …
Traders Hideout
Four New E-mini Futures Launch June 29 -- Russell 3000, …
Emini and Emicro Index
$12M Ceasefire Contract Goes Disputed as Bandar Abbas St …
Prediction Markets & Event Contracts
Warsh Confirmed 54-45 on PPI Day -- 97% Say He Holds in …
Prediction Markets & Event Contracts
Ceasefire Collapse: Iran Fires 24 Missiles, Israel Hits …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
NexusFi site changelog and issues/problem reporting
13 thanks
Darmok and Jalad at Tanagra
3 thanks
Big Mike in Ecuador
1 thanks
30 Sessions
1 thanks
  #3 (permalink)
 wolf50us 
Sarasota + Florida/USA
 
Experience: Advanced
Platform: Ninja,tradestation,metatrader
Trading: Futures eminis
Posts: 6 since Sep 2014
Thanks Given: 2
Thanks Received: 0


I found that by storing variables in the Properties Region that NinjaTrader would automatically serialize them for me. By simply changing where I stored my values everything worked due to the fact the changed values would be
serialized on the F5 event and then restored properly before the historical OnUpdates would be applied.


Started this thread Reply With Quote




Last Updated on June 17, 2015


© 2026 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 - Downloads - Top
no new posts