protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
{
chartScale.Properties.AutoScaleMarginType = AutoScaleMarginType.Percent;
chartScale.Properties.AutoScaleMarginUpper = 30;
chartScale.Properties.AutoScaleMarginLower = 30;
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Setting indicator margin programatically
Collapse
X
-
Setting indicator margin programatically
Hi, I would like to set a margin of 30 Percent automatically in my indicator code. My code is like so:
This code does not generate any errors in the log, but it also prevents my plots from rendering. I just get an empty indicator panel. Did I do it wrong, or is this still not really a supported method? If so, are there any work-arounds to get the same end result? I thought of adding an extra plot above and below that are transparent, but I would rather not have extra plots if possible.Code:Tags: None
-
Hello torch2k,
Thank you for your reply.
Since you're overriding the regular functions of OnRender() with this code, you will need to call the base OnRender() prior to your custom logic so that the plots also render along with your modifications.
Code:protected override void OnRender(ChartControl char tControl, ChartScale chartScale) { // call the base.OnRender() to ensure standard Plots work as designed base.OnRender(chartControl, chartScale); // custom render logic }
Please let us know if we may be of further assistance to you.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
331 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
549 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment