NexusFi: Find Your Edge


Home Menu

 





Plot images in strategy chart


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
 jtorres 
Madrid - SPain
 
Experience: Beginner
Platform: Ninjatrader
Trading: CL Future
Posts: 11 since Sep 2013
Thanks Given: 2
Thanks Received: 0

Hi verybody!

Please, I need help with a code.
I need to show an image or other into a strategy chart depends a variable value while the strategy price are moving.
As we cant use "public override void Plot()" function in strategy charts i am adding a external indicator in Initialize function, but how could I hide and show this images from strategy onBarUpdate function?

Thank you very much !


Indicator code...

public override void Plot(Graphics graphics, Rectangle bounds, double min, double max){

graphics.DrawImage(myImg,0,0);

}


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Coinbase Launches Regulated Crypto Futures Across 26 Eur …
Cryptocurrency
GDP Day: The First Economic Reckoning -- Pahlavi at 6.55 …
Prediction Markets & Event Contracts
CME Cuts Precious Metals Margins Up to 21% Starting Toda …
Commodities
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
The 50/50 Paradox: Peace and Invasion Each at 20% -- Ira …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Lady Vols Primer: Trading Volatility Journal
7 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 2,947 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,860


If you draw an object in NT and give it a name, you can then remove it again as if the condition is no longer valid.

1) named obectrs :

Draw a rectangle :
DrawRectangle ("Ubox1", showScaled, barsago, Low, 0, High, Color.Red, Color.Red, 2);

Remove this rectangle :
RemoveDrawObject ("Ubox1");

2) In your case, if you draw with graphics.Drawimg, you need to repaint the hole screen, this can be
done with : ChartControl.Refresh();
but the screen might flicker

good luck


Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 jtorres 
Madrid - SPain
 
Experience: Beginner
Platform: Ninjatrader
Trading: CL Future
Posts: 11 since Sep 2013
Thanks Given: 2
Thanks Received: 0

Thanks rleplae

I dont want to destroy or remove the image objects.
I need to show or hide this created images several times depending a variable value.

Some ideas? Thanks


Started this thread Reply With Quote
  #5 (permalink)
 
rleplae's Avatar
 rleplae 
Gits (Hooglede) Belgium
Legendary Market Wizard
 
Experience: Master
Platform: NinjaTrader, Proprietary,
Broker: Ninjabrokerage/IQfeed + Synthetic datafeed
Trading: 6A, 6B, 6C, 6E, 6J, 6S, ES, NQ, YM, AEX, CL, NG, ZB, ZN, ZC, ZS, GC
Posts: 2,947 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,860

Do you need to have an image or if the built-in shapes/text are sufficient ,
then i would recommend de first way, draw and remove if needed


Follow me on X Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 jtorres 
Madrid - SPain
 
Experience: Beginner
Platform: Ninjatrader
Trading: CL Future
Posts: 11 since Sep 2013
Thanks Given: 2
Thanks Received: 0

Thanks again rleplae

I want load 2 images and hidde or show when i need, but if its not possible... how could i code the built-in shapes/text


Started this thread Reply With Quote




Last Updated on August 22, 2016


© 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