Help coding DV2 indicator - NinjaTrader Programming | futures io social day trading

Help coding DV2 indicator
 Updated: August 22nd, 2014 (07:26 PM) Views / Replies: 3,005 / 3 Created: March 29th, 2010 (10:48 PM) by bigAllan Attachments: 1

 Welcome to futures io.

# Help coding DV2 indicator

Just starting out...
New York City

Futures Experience: Intermediate
Platform: NT,R,Matlab

Posts: 2 since Mar 2010
Thanks: 0 given, 0 received

Help coding DV2 indicator

Hey guys, I do most of my work in R/Java and am new to ninjatrader. I am trying to write a simple ninjascript based on the DV2. I have wrote out the code, but it does not work properly. I am using yahoo historical pricing for my data. I have attached my script and would appreciate any pointers or tips about what is wrong with my script.

The DV2 indicator from (Varadi?s RSI(2) Alternative: The DV(2) MarketSci Blog) is calculated as follows: (a) for each trading day calculate: [(close / average of the high and low price) – 1]. And then (b) take the average of today and yesterday’s result.

Thanks,
Allan

Attached Files
 Register to download DV2.cs (5.7 KB, 35 views)

 March 29th, 2010, 10:48 PM #2 (permalink) Quick Summary Quick Summary Post Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500

Posts: 46,238 since Jun 2009
Thanks: 29,350 given, 83,214 received

I think the "-1" is probably meaning one day (or index) old.

Try:

Code
 if(CurrentBar < 2) return;            {                today = (Close[0] / (.5* (High[0] + Low[0]))) - Close[1];                                Value.Set(.5 * (yesterday + today)  );                                yesterday = today;            }
Also on a side note, please share your R knowledge and code examples, we could use some help in that area.

Downloads - Matlab Functions - Big Mike's Day Trading Forum

If the code I provided above doesn't work let me know, I don't have Ninja loaded so didn't test it.

Mike

Elite Member
Porto Portugal

Futures Experience: Intermediate
Platform: IB
Favorite Futures: Stocks

Posts: 15 since Mar 2012
Thanks: 8 given, 3 received

bigAllan
 Hey guys, I do most of my work in R/Java and am new to ninjatrader. I am trying to write a simple ninjascript based on the DV2. I have wrote out the code, but it does not work properly. I am using yahoo historical pricing for my data. I have attached my script and would appreciate any pointers or tips about what is wrong with my script. The DV2 indicator from (Varadi?s RSI(2) Alternative: The DV(2) MarketSci Blog) is calculated as follows: (a) for each trading day calculate: [(close / average of the high and low price) – 1]. And then (b) take the average of today and yesterday’s result. Thanks, Allan

Can someone say if this indicator (Attached in first message) are work? And the formula are ok?
Because he say " but it does not work properly.".

If no, can someone, please, do this indicator?

I search here, but not find.
Thanks

If someone can programm and do a indicator, I can search for the formula.

edit: And if not ask much... and do this Indicator:
IBS = (Close - Low)/(High - Low)

Is for use in systems wizard in Ninja.
Thanks again

Last edited by jmagaia; August 22nd, 2014 at 08:25 PM.

 futures io > Help coding DV2 indicator

Upcoming Webinars and Events (4:30PM ET unless noted)

Elite only

Elite only

January

## Ran Aroussi: TBA

Elite only

 Similar Threads Thread Thread Starter Forum Replies Last Post johni EasyLanguage Programming 18 March 20th, 2012 06:05 AM hector24 NinjaTrader Programming 8 July 13th, 2011 10:10 PM syxforex NinjaTrader 5 May 15th, 2010 12:23 PM TheWizard NinjaTrader Programming 4 May 11th, 2010 11:05 AM Saroj NinjaTrader Programming 8 October 21st, 2009 02:32 AM

All times are GMT -4. The time now is 09:23 AM.

 Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io All information is for educational use only and is not investment advice.There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-11 in 0.09 seconds with 20 queries on phoenix via your IP 54.226.227.175