Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
IndicatorBase objects
Collapse
X
-
Originally posted by Locke View Post
-
Hello Locke,
Thank you for your post.
This would just be considered unsupported code.
Leave a comment:
-
IndicatorBase objects
Here I go again poking around where I shouldn't.
When you call Add() in Initialize() in a strategy, I typically saw it written as :
Add(SMA(10));
But the compiler shows it's looking for an IndicatorBase object. So just for fun I went:
private IndicatorBase mySMA = null;
mySMA = SMA(10);
Add(mySMA);
mySMA.Plots[0].Pen.Color = Color.Orange;
And wow, everything worked. Then I went to look in the docs and did a search for IndicatorBase and NOTHING CAME UP!
I'm very new at all of this - does this mean this is a new class? Or just something as an end user we shouldn't mess with? I'm trying to learn HOW to learn Ninjascript, and finding an important class NOT in the docs scares me.
Ok, just wondering. I thought making an object reference for the indicator would be better than calling (or typing out) full indicators everytime you need to work with one. Maybe there is no speed difference at all and I just wasted everyone's time who read this, haha.Tags: None
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by f.saeidi, Today, 10:19 AM
|
1 response
4 views
0 likes
|
Last Post Today, 10:31 AM | ||
Started by kujista, Today, 06:23 AM
|
5 responses
15 views
0 likes
|
Last Post
by kujista
Today, 10:26 AM
|
||
Started by traderqz, Yesterday, 09:06 AM
|
2 responses
17 views
0 likes
|
Last Post
by traderqz
Today, 09:48 AM
|
||
Started by traderqz, Today, 12:06 AM
|
3 responses
6 views
0 likes
|
Last Post Today, 09:41 AM | ||
Started by RideMe, 04-07-2024, 04:54 PM
|
5 responses
28 views
0 likes
|
Last Post Today, 08:48 AM |
Leave a comment: