NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 11-07-2008, 09:08 AM   #1
iangohye
Junior Member
 
Join Date: Aug 2008
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default Converting eld to nt

Hi im looking for help from ppl who have experience in easy language.

ive got the following code im attempting to convert to ninjascript:

Value1 = 2 * WAverage(price, halvedLength);
Value2 = WAverage(price, length);
Value3 = WAverage((Value1 - Value2), sqrRootLength);

The variable price is a NumericSeries. Value1 and Value2 are double.

What i dont get is that you can do a WAverage from Value1-Value2? Im underthe impression that weighted averages take a defined period of a certain price type. Wha does taking a weighted average of Value1-Value2 mean?

Having problems understanding this, would appreciate any help
thanks
ian
iangohye is offline  
Reply With Quote
Old 11-07-2008, 09:15 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,411
Thanks: 252
Thanked 976 times in 959 posts
Default

Quote:
Originally Posted by iangohye View Post
Hi im looking for help from ppl who have experience in easy language.

ive got the following code im attempting to convert to ninjascript:

Value1 = 2 * WAverage(price, halvedLength);
Value2 = WAverage(price, length);
Value3 = WAverage((Value1 - Value2), sqrRootLength);

The variable price is a NumericSeries. Value1 and Value2 are double.

What i dont get is that you can do a WAverage from Value1-Value2? Im underthe impression that weighted averages take a defined period of a certain price type. Wha does taking a weighted average of Value1-Value2 mean?

Having problems understanding this, would appreciate any help
thanks
ian
Hi ian,

Thanks for your post.

This just means it smoothes the difference (momentum) of Value1 - Value2 of the specified period input, in this case 'sqrRootLength'.

The 'Input' does not have to be a Price type one (OHLC), but any type of a series of values, like other indicators for example, or volume.
Last edited by NinjaTrader_Bertrand; 11-08-2008 at 08:59 AM.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 11-07-2008, 05:10 PM   #3
iangohye
Junior Member
 
Join Date: Aug 2008
Posts: 13
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks Bertrand for your reply

Yup youve confirmed my understanding of averages. (ie. require a set of numbers over a certain period)

But if the input requires a series of values, how does (Value1 - Value2) fit in there? since (Value1 - Value2) returns a single, double value.
iangohye is offline  
Reply With Quote
Old 11-08-2008, 07:24 AM   #4
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

You have to store Value1 - Value2 calculation for each bar in a DataSeries and then take the average of the DataSeries.

More information - http://www.ninjatrader-support.com/H...iesObject.html
NinjaTrader_Ray is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting easy language chartlearner General Programming 11 09-23-2008 11:39 AM
Converting to Market Orders PHOLAN Automated Trading 12 06-01-2008 03:12 PM
Converting Int to Double BenHeaton General Programming 2 03-01-2008 05:19 AM
TS8 eld file missing in latest v6.5 beta jtrade Connecting 2 01-14-2008 10:53 AM
Converting TS strategy signals to NT Elfsareus Automated Trading 7 02-15-2006 02:32 PM


All times are GMT -6. The time now is 07:50 AM.