NexusFi: Find Your Edge


Home Menu

 





Plot images in strategy chart


Discussion in NinjaTrader

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




 
Search this Thread

Plot images in strategy chart

  #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?
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
What broker to use for trading palladium futures
Commodities
MC PL editor upgrade
MultiCharts
About a successful futures trader who didnt know anythin …
Psychology and Money Management
 
  #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: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863


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 Twitter 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: 3,003 since Sep 2013
Thanks Given: 2,442
Thanks Received: 5,863

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 Twitter 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


© 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