Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Single line script translate please~~
Updated October 8, 2015
Top Posters
looks_one
Fat Tails
with 4 posts (2 thanks)
looks_two
KFurious
with 3 posts (0 thanks)
looks_3
zeller4
with 1 posts (0 thanks)
looks_4
Quick Summary
with 1 posts (0 thanks)
trending_up
3,514 views
thumb_up
2 thanks given
group
3 followers
forum
7 posts
attach_file
2 attachments
Single line script translate please~~
July 27th, 2011, 03:56 AM
Hong Kong
Posts: 3 since Jan 2011
Thanks Given: 2
Thanks Received: 0
Hi there, could anybody transcript this single code for me plz? I'm not a programmer and the only programming language I can do is Metastock language...seems got a really big difference with it....ouch....
H-L>Mov(H-L,10,S)*2
Thank you very much~~
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
July 27th, 2011, 06:11 AM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102
KFurious
Hi there, could anybody transcript this single code for me plz? I'm not a programmer and the only programming language I can do is Metastock language...seems got a really big difference with it....ouch....
H-L>Mov(H-L,10,S)*2
Thank you very much~~
This is the NinjaTrader code:
Code
High[0]-Low[0] > 2 * (SMA(High,10)[0] - SMA(Low,10)[0]);
July 27th, 2011, 08:22 AM
Hong Kong
Posts: 3 since Jan 2011
Thanks Given: 2
Thanks Received: 0
Thanks a lot Fat Tails~
Would you also tell me how can I make it just valid if the last bar's signal = false?
In Metastock, I just write like this...
Signal and ref(Signal,-1)=false
Thank you~~
July 27th, 2011, 11:27 AM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102
KFurious
Thanks a lot Fat Tails~
Would you also tell me how can I make it just valid if the last bar's signal = false?
In Metastock, I just write like this...
Signal and ref(Signal,-1)=false
Thank you~~
NinjaTrader references the CurrentBar with [0], if you want to reference the previous bar, you would use [1]. The code would therefore be
Code
if (High[0]-Low[1] > 2 * (SMA(High,10)[1] - SMA(Low,10)[1]))
You can also print out the NinjaTrader help file (900 pages), you will find everything needed.
July 28th, 2011, 03:40 AM
Hong Kong
Posts: 3 since Jan 2011
Thanks Given: 2
Thanks Received: 0
Thanks again Fat Tails, would you suggest any tutorial or ebook which cover more in details about NT programming?
Or should I learn C# first before that?
July 28th, 2011, 03:43 AM
Berlin, Europe
Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102
KFurious
Thanks again Fat Tails, would you suggest any tutorial or ebook which
cover more in details about NT programming?
Or should I learn C# first before that?
I would suggest to dig through a book, something like "C# in 20 days". Then just copy and paste code from existing indicators and use the NinjaScript reference. That should do.
October 7th, 2015, 11:51 PM
Orlando Florida
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404
Hello,
This is from a "Volume Momentum " Indicator from Barbara Star:
Quoting
Barbara Star discusses volume variations. The title of the article is: Volume Variations.
Mov(ROC(Cum(If(C>(H+L)/2,V,If(C<(H+L)/2,-V,0))),12,$),10,S)
I'm not sure how to do the Cumulative portion of the formula. I'm also not sure about the "$".
Here's my attempt.
Code
//variables:
private int emaperiod = 10;
private int rocperiod = 12;
private DataSeries _rocvol;
//Mov(ROC((Cum(If(C>(H+L)/2,V, If(C<(H+L)/2,-V,0)))),12,$),10,S)
bool aboveMid = (Close[0]>(High[0]+Low[0])/2);
bool belowMid = (Close[0]<(High[0]+Low[0])/2);
_rocvol.Set(aboveMid ? ROC(Volume,rocperiod)[0] :
belowMid ? -1*ROC(Volume,rocperiod)[0] : 0);
VolMom.Set(EMA(_rocvol,emaperiod)[0]);
Not sure what the end result would look like but I posted a screenshot of mine...
p.s., is there a MetaStock resource library for Ninjascript porting?
Attached Thumbnails
Attached Files
Elite Membership required to download: VolumeMomentum_v01.cs
Last Updated on October 7, 2015