NT8 - @SMA protected override void OnBarUpdate() { if (IsFirstTickOfBar) priorSum = sum; sum = priorSum + Input[0] - (CurrentBar >= Period ? Input[Period] : 0); Value[0] = sum / (CurrentBar < Period ? CurrentBar + 1 : Period); }
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
What is Input ?
Collapse
X
-
SMA Math functions were removed in NT8, and we also added some caching techniques to improve performance in many indicators.
Code:MatthewNinjaTrader Product Management
-
-
Originally posted by NinjaTrader_Matthew View PostSMA Math functions were removed in NT8, and we also added some caching techniques to improve performance in many indicators.
Code:NT8 - @SMA protected override void OnBarUpdate() { if (IsFirstTickOfBar) priorSum = sum; sum = priorSum + Input[0] - (CurrentBar >= Period ? Input[Period] : 0); Value[0] = sum / (CurrentBar < Period ? CurrentBar + 1 : Period); }
Thanks! Well, If you guys had given me a beta access as an EX, current or future developer, I would be able to take a peek by myself.
Comment
-
Originally posted by BankRobber View PostNOT bad, how about you stop checking is it BAR 0 on every single bar.
And how about you kick out ALL of the math. min?
Code:if(CurrentBar >= period) { if(FirstTickOfBar) last = Value[1] * period - Input[period]; Value.Set((last + Input[0])/period); } else if (CurrentBar > 0) { if(FirstTickOfBar) last= Value[1] * CurrentBar; Value.Set((last + Input[0])/(CurrentBar + 1)); } else Value.Set(Input[0]);
Comment
-
Originally posted by BankRobber View PostWhat is MSIL??? My guess is that's the main reason of using variables like NinjaTurtle & Snail, right?
Sorry for my ignorance, I'm coming from the "native" world
Do not apologize for seeking to know! We all started somewhere.
Comment
-
Originally posted by koganam View Postref: https://en.wikipedia.org/wiki/Common...diate_Language
Do not apologize for seeking to know! We all started somewhere.
C# & NET is the main reason, why NinjaTrader is soooo SLOOOOW.
If you don't believe me, do your own tests. I've done mine long time ago.
NinjaTrader 8 is in development for more than 3 years. What do you think why?
What do i expect from Ninja 8? Absolutely nothing. Just more lipstick added to a old & tired snail. Unless of course they've spent these 3 years in rewriting 90% of NinjaTrader into native code, nothing will change. As a lifetime licence holder, I'm very disappointed.
Comment
-
Originally posted by BankRobber View PostIf you did't realize I was being sarcastic. I'm an old school guy, and I started 30 years ago in the world of machine coding. I just simply DON'T want to know anything about MSIL, because C# doesn't produce NATIVE code.
C# & NET is the main reason, why NinjaTrader is soooo SLOOOOW.
If you don't believe me, do your own tests. I've done mine long time ago.
NinjaTrader 8 is in development for more than 3 years. What do you think why?
What do i expect from Ninja 8? Absolutely nothing. Just more lipstick added to a old & tired snail. Unless of course they've spent these 3 years in rewriting 90% of NinjaTrader into native code, nothing will change. As a lifetime licence holder, I'm very disappointed.
Later coding in Assembler in the halcyon days of the weak, first PC's, was not much fun either, when seen in hindsight, even if I had more complete control over the hardware.
Do I hate managed frameworks? Yes, they are resource hogs that run too slowly. That is why I refused to even learn Java.
However, I need to live in the current world, and have no desire to write a trading application from scratch. Railing against the machine pays no dividends. I made a choice, and I will just live with it until something better comes along.
I never recommend anything other than NT, but there are trading applications written in C and C++. I tried quite a number of them. To me, they were deficient compared to NT. Having to use C# is, for me, a small price to pay to use what I consider to be an all-round superior application.
As always, your milage may vary.
Just my $0.02.Last edited by koganam; 08-26-2015, 04:40 PM.
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
12 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
15 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
Comment