Sorry, please find attached un protected file
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Help with Indicator Development
Collapse
X
-
-
Hello sandeshrai,
Thank you for your response.
Please remove the following lines from the Initilize() method and place them in the OnBarUpdate() method at the beginning:
Please let me know if I may be of further assistance.Code:protected override void OnBarUpdate() { if (CurrentBar < 200) return; indSMAFast = SMA(this.iSMAFast); indSMAFast.Plots[0].Pen.Color = Color.Purple; indSMAMedium = SMA(this.iSMAMedium); indSMAMedium.Plots[0].Pen.Color = Color.DarkBlue; indSMASlow = SMA(this.iSMASlow); indSMASlow.Plots[0].Pen.Color = Color.ForestGreen; indSMAVSlow = SMA(this.iSMAVSlow); indSMAVSlow.Plots[0].Pen.Color = Color.Red;
Comment
-
Your conditions are never being met, because you have only created your SMA's wiithout ever synchronizing them to any object or barSeries.Originally posted by sandeshrai View PostHi Patrick,
I added the Print statements, but that doesn ot print either. Additionally, I tried to have the SMA to be visible on the chart by adding the line :Add (indSMAFast);. I get the error messages
The best overloaded method match for 'NinjaTrader.Indicator.IndicatorBase.Add(NinjaTrad er.Gui.Chart.Line)' has some invalid arguments
and
Argument '1': cannot convert from 'NinjaTrader.Indicator.SMA' to 'NinjaTrader.Gui.Chart.Line'
I have attached a text file with the entire code
Move the code that you use to assign the named instances of SMA to their objects into OnStartUp().Last edited by koganam; 01-25-2014, 01:46 PM.
Comment
-
Updated code as per your suggestion
I updated the code as suggested by you. It still does not do what it is supposed to do.
Originally posted by NinjaTrader_PatrickH View PostHello sandeshrai,
Thank you for your response.
Please remove the following lines from the Initilize() method and place them in the OnBarUpdate() method at the beginning:
Please let me know if I may be of further assistance.Code:protected override void OnBarUpdate() { if (CurrentBar < 200) return; indSMAFast = SMA(this.iSMAFast); indSMAFast.Plots[0].Pen.Color = Color.Purple; indSMAMedium = SMA(this.iSMAMedium); indSMAMedium.Plots[0].Pen.Color = Color.DarkBlue; indSMASlow = SMA(this.iSMASlow); indSMASlow.Plots[0].Pen.Color = Color.ForestGreen; indSMAVSlow = SMA(this.iSMAVSlow); indSMAVSlow.Plots[0].Pen.Color = Color.Red;
Comment
-
-
Updated code attached
Here is the updated code attachedAttached Files
Comment
-
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
29 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|
||
|
Started by CarlTrading, 07-05-2026, 01:16 PM
|
0 responses
17 views
0 likes
|
Last Post
by CarlTrading
07-05-2026, 01:16 PM
|
||
|
Started by CaptainJack, 06-17-2026, 10:32 AM
|
0 responses
9 views
0 likes
|
Last Post
by CaptainJack
06-17-2026, 10:32 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:15 AM
|
0 responses
15 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:15 AM
|
||
|
Started by kinfxhk, 06-17-2026, 04:06 AM
|
0 responses
18 views
0 likes
|
Last Post
by kinfxhk
06-17-2026, 04:06 AM
|

Comment