Referencing an indicator setting within a strategy script - NinjaTrader Programming | futures io social day trading
futures io futures trading


Referencing an indicator setting within a strategy script
Updated: Views / Replies:1,865 / 7
Created: by ktmdave Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you dont need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

Referencing an indicator setting within a strategy script

  #1 (permalink)
Elite Member
Sacramento, CA
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 13 since Apr 2011
Thanks: 2 given, 1 received

Referencing an indicator setting within a strategy script

How do I OR what is the best way of referencing a custom indicator in my strategy script (within onbarupdate() function).

For example, say I was using the ADXVMA indicator. In my strategy I would want to reference when the line changes from yelllow to red.

What variables are available to do this?

Is there a way to list out all of the variables I could reference on a certain indicator?

Assume the indicator is already initialized in the strategy as Add(_ADXMVA_V01_5_2(9,True));

Thanks in advance!

Reply With Quote
 
  #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.

 
  #3 (permalink)
 Vendor: www.coroin.com 
Galveston ,TX
 
Futures Experience: Intermediate
Platform: NT7
Broker/Data: Zaner
Favorite Futures: Futures
 
Posts: 386 since Mar 2010
Thanks: 364 given, 433 received


sorry for the brief and (likely) incomplete response ...

any public property of an indicator is available to you in the strategy. for example, say you added bollinger bands, you can access Bollinger(Median, 2.0, 21).Upper[0] within OnBarUpdate().
(note: Upper is one of properties of the Bollinger() standard indicator, as is Lower; the number 0 in square-brackets refers to current bar in the series)

so the practical application is: code your custom indicators so you can access the properties in a strategy.

hope this points you in the right direction.

cheers,
-e


Last edited by eman; April 27th, 2011 at 02:36 PM. Reason: clarification
Reply With Quote
 
  #4 (permalink)
Elite Member
Singapore
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Charts
Broker/Data: Thinkorswim, IQFeed
Favorite Futures: Options of SPY, IWM, QQQ
 
wccktrader's Avatar
 
Posts: 47 since Nov 2010
Thanks: 54 given, 141 received


ktmdave View Post

For example, say I was using the ADXVMA indicator. In my strategy I would want to reference when the line changes from yelllow to red.

ADXVMA changing from yellow to red ....try this:


if (CurrentBar < 2)
return;

if ( _ADXVMA_v01_5_2(9, true).Main[0] < _ADXVMA_v01_5_2(9, true).Main[1]

&& _ADXVMA_v01_5_2(9, true).Main[1] == _ADXVMA_v01_5_2(9, true).Main[2])

{

do something

}

Reply With Quote
 
  #5 (permalink)
Elite Member
Sacramento, CA
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 13 since Apr 2011
Thanks: 2 given, 1 received

What is the reason for
if (CurrentBar < 2)
return;


??

THanks!!!


wccktrader View Post
ADXVMA changing from yellow to red ....try this:


if (CurrentBar < 2)
return;

if ( _ADXVMA_v01_5_2(9, true).Main[0] < _ADXVMA_v01_5_2(9, true).Main[1]

&& _ADXVMA_v01_5_2(9, true).Main[1] == _ADXVMA_v01_5_2(9, true).Main[2])

{

do something

}


Reply With Quote
 
  #6 (permalink)
Elite Member
Singapore
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Charts
Broker/Data: Thinkorswim, IQFeed
Favorite Futures: Options of SPY, IWM, QQQ
 
wccktrader's Avatar
 
Posts: 47 since Nov 2010
Thanks: 54 given, 141 received

Make sure you have enough bars in the data series you are accessing

It is to ensure that there are enough bars in data series you are accessing (as the code makes reference to data 2 bars back.

More info in this thread: Make sure you have enough bars in the data series you are accessing - NinjaTrader Support Forum

Reply With Quote
The following user says Thank You to wccktrader for this post:
 
  #7 (permalink)
Elite Member
Sacramento, CA
 
Futures Experience: Beginner
Platform: NinjaTrader
Favorite Futures: Futures
 
Posts: 13 since Apr 2011
Thanks: 2 given, 1 received

Awesome. And I assume that .Main[0] is referencing slope at the current bar?

dave


wccktrader View Post
It is to ensure that there are enough bars in data series you are accessing (as the code makes reference to data 2 bars back.

More info in this thread: Make sure you have enough bars in the data series you are accessing - NinjaTrader Support Forum


Reply With Quote
 
  #8 (permalink)
Elite Member
Singapore
 
Futures Experience: Intermediate
Platform: NinjaTrader, Sierra Charts
Broker/Data: Thinkorswim, IQFeed
Favorite Futures: Options of SPY, IWM, QQQ
 
wccktrader's Avatar
 
Posts: 47 since Nov 2010
Thanks: 54 given, 141 received


ktmdave View Post
Awesome. And I assume that .Main[0] is referencing slope at the current bar?

dave

.Main[0] is the ADXVMA line itself. .Main[0] - .Main[1] is the current slope. .Main[1] - .Main[2] is the slope of the previous bar.

Reply With Quote

Reply



futures io > > > > > Referencing an indicator setting within a strategy script

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ninjatrader7 ATM Strategy combine with Strategy Wizard Ninja Script schuster21 NinjaTrader Programming 4 July 4th, 2011 05:39 PM
ATM TRADING USING SCRIPT STRATEGY demit177 NinjaTrader Programming 4 May 29th, 2011 10:37 PM
Setting up a strategy: confused with all the methods wown NinjaTrader Programming 17 March 9th, 2011 08:08 PM
Reading Interval setting in Strategy leduc NinjaTrader Programming 4 May 26th, 2010 07:48 PM
Referencing values in another indicator or Saroj NinjaTrader Programming 0 September 5th, 2009 12:02 AM


All times are GMT -4. The time now is 05:25 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-16 in 0.11 seconds with 19 queries on phoenix via your IP 54.160.245.121