NexusFi: Find Your Edge


Home Menu

 





public override void Plot VS multiple dataseries


Discussion in NinjaTrader

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




 
Search this Thread

public override void Plot VS multiple dataseries

  #1 (permalink)
 
AkLio's Avatar
 AkLio 
Canada
 
Experience: Intermediate
Platform: ninja 7
Broker: IB
Trading: 6E ES
Posts: 38 since Jun 2009
Thanks Given: 28
Thanks Received: 69

Hi every1,

If some1 could help, would be much appreciated
I've written a few indicators using "public override void Plot"
... like many you'll found in the futures.io (formerly BMT) download section

My problem is that when I call 2 dataseries on the same chart of NT, the "drawing" part of the indicator freeze on the chart and, moving my scrollbar right or left have totally no effect on it... but I see everrything else moving ....

See pic attached ot try to make myself clearer... in this exemple, I redraw the candles over those of NT ... but totally frozen on the chart when I insert a second dataserie for the 5 min candles.

I guess NT dont like the "public" part of "public override void Plot", and "private" does not work ...

Thanks

Attached Thumbnails
Click image for larger version

Name:	2013-11-02 13-27-47.png
Views:	219
Size:	69.3 KB
ID:	127508  
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
Increase in trading performance by 75%
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
20 thanks
GFIs1 1 DAX trade per day journal
16 thanks
  #3 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


It should not be any issue with 'public' - more likely the code in the Plot method is not actually doing what you expect (e.g. lock up in the 'while' statement, or not using bar offsets correctly, or attaching to the wrong data series?. Given the glimpse of ChartControl I assume you are using direct draw graphics for a specific overlay requirement which require a full redraw on every call, otherwise could you simplify the indicator to just use Ninja Draw methods?

Without seeing more of the code it is hard to suggest much else, except maybe never underestimate the usefulness of simple 'Print' calls with the Ninja Output Window opened up, frequently overlooked and often still the best spanner in the box.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 
AkLio's Avatar
 AkLio 
Canada
 
Experience: Intermediate
Platform: ninja 7
Broker: IB
Trading: 6E ES
Posts: 38 since Jun 2009
Thanks Given: 28
Thanks Received: 69

Thank you for your reply Ratfink

If you want to give it a try, here's a little indicator with the same kind of bug that use the

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

It's a simple stochastic indicator that fills the space between the K and the D ... color is different if K > D or D > k ...

Everything work fine until you insert a second dataserie in the chart

Thanks




ratfink View Post
It should not be any issue with 'public' - more likely the code in the Plot method is not actually doing what you expect (e.g. lock up in the 'while' statement, or not using bar offsets correctly, or attaching to the wrong data series?. Given the glimpse of ChartControl I assume you are using direct draw graphics for a specific overlay requirement which require a full redraw on every call, otherwise could you simplify the indicator to just use Ninja Draw methods?

Without seeing more of the code it is hard to suggest much else, except maybe never underestimate the usefulness of simple 'Print' calls with the Ninja Output Window opened up, frequently overlooked and often still the best spanner in the box.


Attached Thumbnails
Click image for larger version

Name:	2013-11-03 15-57-28.png
Views:	168
Size:	9.7 KB
ID:	127539  
Attached Files
Elite Membership required to download: LioStochBand2.cs
Started this thread Reply With Quote
  #5 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425

Hi,

I'm not able to test anything now, but it should be ok if you just add:

 
Code
if (BarsInProgress != 0)
    return;
at the beginning of the Plot method (and for most also in OnBarUpdate), that will stop the second (or more) data series getting involved.

Cheers

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
AkLio's Avatar
 AkLio 
Canada
 
Experience: Intermediate
Platform: ninja 7
Broker: IB
Trading: 6E ES
Posts: 38 since Jun 2009
Thanks Given: 28
Thanks Received: 69

I tried without success ...
Thanks anyway for your help !
Lio


ratfink View Post
Hi,

I'm not able to test anything now, but it should be ok if you just add:

 
Code
if (BarsInProgress != 0)
    return;
at the beginning of the Plot method (and for most also in OnBarUpdate), that will stop the second (or more) data series getting involved.

Cheers


Started this thread Reply With Quote
  #7 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


AkLio View Post
I tried without success ...
Thanks anyway for your help !
Lio

Yes, sorry, was just turning in for sleep and realised what I posted is for multi-instrument series using the 'Add()' method and not multi-dataseries added from the GUI, I will have a look when I can test tomorrow unless one of the other serious C#'ers solves it before then.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on November 3, 2013


© 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