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 charlesugo_1, 05-26-2026, 05:03 PM
|
0 responses
70 views
0 likes
|
Last Post
by charlesugo_1
05-26-2026, 05:03 PM
|
||
|
Started by DannyP96, 05-18-2026, 02:38 PM
|
1 response
152 views
0 likes
|
Last Post
|
||
|
Started by CarlTrading, 05-11-2026, 05:56 AM
|
0 responses
162 views
0 likes
|
Last Post
by CarlTrading
05-11-2026, 05:56 AM
|
||
|
Started by CarlTrading, 05-10-2026, 08:12 PM
|
0 responses
100 views
0 likes
|
Last Post
by CarlTrading
05-10-2026, 08:12 PM
|
||
|
Started by Hwop38, 05-04-2026, 07:02 PM
|
0 responses
288 views
0 likes
|
Last Post
by Hwop38
05-04-2026, 07:02 PM
|

Comment