Bars Ago in an indicator - NinjaTrader Programming | futures io social day trading
futures io futures trading


Bars Ago in an indicator
Updated: Views / Replies:3,971 / 22
Created: by patbateman Attachments:1

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 donít 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
 1  
 
Thread Tools Search this Thread
 

Bars Ago in an indicator

  #1 (permalink)
Elite Member
NY, NY
 
Futures Experience: None
Platform: T4, NinjaTrader
Favorite Futures: All!
 
patbateman's Avatar
 
Posts: 235 since Mar 2012
Thanks: 113 given, 193 received

Bars Ago in an indicator

So the Bars Ago function only works in strategies...


How can I get bars ago in an indicator? Example, Close[0] - Close[90] would plot the difference between the current bar and the bar from 90 bars ago.

I'm sure this has been answered somewhere, but I've searched and can't find, so my apologies in advance!

"A Jedi's strength flows from the force."
-Yoda
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)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received



patbateman View Post
So the Bars Ago function only works in strategies...


How can I get bars ago in an indicator? Example, Close[0] - Close[90] would plot the difference between the current bar and the bar from 90 bars ago.

I'm sure this has been answered somewhere, but I've searched and can't find, so my apologies in advance!

Not sure I understand what you are asking for, your example seems to answer your question. Can you restate you needs in another way?

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
 
  #4 (permalink)
Elite Member
NY, NY
 
Futures Experience: None
Platform: T4, NinjaTrader
Favorite Futures: All!
 
patbateman's Avatar
 
Posts: 235 since Mar 2012
Thanks: 113 given, 193 received


Tasker_182 View Post
Not sure I understand what you are asking for, your example seems to answer your question. Can you restate you needs in another way?

Yes, my poalogies...


The bars ago function does not work in NT indicators. Only NT Strategies. I verified this with NT.

So I'm looking for another way to model a lookback (or a displacement, as its called in the indicator window).

So I want to do an alternative for the bars ago function... Close[0] - Close[x] I'll be working it into something more complex, but I can go from here if any kind souls want to help my stump!

"A Jedi's strength flows from the force."
-Yoda
Reply With Quote
 
  #5 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received


patbateman View Post
Yes, my poalogies...


The bars ago function does not work in NT indicators. Only NT Strategies. I verified this with NT.

So I'm looking for another way to model a lookback (or a displacement, as its called in the indicator window).

So I want to do an alternative for the bars ago function... Close[0] - Close[x] I'll be working it into something more complex, but I can go from here if any kind souls want to help my stump!

Some days I can't see the forest for the trees and today is one of those days, sorry.

In this lookback, are you trying to go back X number of bars to see something or are you trying to scan for a value that may have occurred over the last x bars? Hey if you have strategy code that does what you need or if you had a picture of your needs I may be able to see something to help with.

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
 
  #6 (permalink)
Elite Member
NY, NY
 
Futures Experience: None
Platform: T4, NinjaTrader
Favorite Futures: All!
 
patbateman's Avatar
 
Posts: 235 since Mar 2012
Thanks: 113 given, 193 received

I'm just looking for an alternate to bars ago, besides using close[3] for example. The bars ago function does NOT work in indicators. I don't want a strategy, just an indicator.

"A Jedi's strength flows from the force."
-Yoda
Reply With Quote
 
  #7 (permalink)
Market Wizard
virginia
 
Futures Experience: Intermediate
Platform: ninja
Favorite Futures: ES
 
cory's Avatar
 
Posts: 5,220 since Jun 2009
Thanks: 628 given, 6,318 received
Forum Reputation: Legendary

I don't understand this at all!

Reply With Quote
The following 3 users say Thank You to cory for this post:
 
  #8 (permalink)
Elite Member
NY, NY
 
Futures Experience: None
Platform: T4, NinjaTrader
Favorite Futures: All!
 
patbateman's Avatar
 
Posts: 235 since Mar 2012
Thanks: 113 given, 193 received

The bars ago function does NOT work when creating ninjascript for indicators. It ONLY works for creating indicators for strategies.

In other words, if you make an indicator that is simply Close[10], it will not function. It will compile, but the compiler will not read it.

So, I'm trying to figure out a way to use something like bars ago that does not involve the traditional approach.

If I can get just Close[0] - Close[20] to work, I can go from there.

Hope this helps!

"A Jedi's strength flows from the force."
-Yoda
Reply With Quote
 
  #9 (permalink)
Elite Member
Cedar Rapids, iowa
 
Futures Experience: Intermediate
Platform: Ninjatrader
Broker/Data: Ninjatrader - Continuum
Favorite Futures: 6E, TF, 6J
 
Tasker_182's Avatar
 
Posts: 626 since Aug 2009
Thanks: 426 given, 1,126 received


patbateman View Post
The bars ago function does NOT work when creating ninjascript for indicators. It ONLY works for creating indicators for strategies.

In other words, if you make an indicator that is simply Close[10], it will not function. It will compile, but the compiler will not read it.

So, I'm trying to figure out a way to use something like bars ago that does not involve the traditional approach.

If I can get just Close[0] - Close[20] to work, I can go from there.

Hope this helps!

Maybe I'm overthinking this. Lets use your example as an example, Close[0] - Close[20]

if you create a variable to put the results in, will that not meet your needs?

IE:

double diff = Close[0] - Close[20] ;

So the above code statement declares a variable called "diff" that is a double type. Next (on the other side of equals) the difference between Close[0] and Close[20] is put into diff. The ";" ends the C# statement.

Is that what you want?

"Money is better than poverty, if only for financial reasons." - Woody Allen
Reply With Quote
The following 2 users say Thank You to Tasker_182 for this post:
 
  #10 (permalink)
Market Wizard
Columbus, OH
 
Futures Experience: None
Platform: NT 8, TOS
Favorite Futures: ES
 
Silvester17's Avatar
 
Posts: 3,332 since Aug 2009
Thanks: 4,579 given, 10,313 received



patbateman View Post
So the Bars Ago function only works in strategies...



I might not understand either, but bars ago should be working in an indicator:

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
The following user says Thank You to Silvester17 for this post:

Reply



futures io > > > > > Bars Ago in an indicator

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
Scan for Gap Up N Bars Ago idenr ThinkOrSwim Programming 1 April 10th, 2013 10:17 PM
difference between prevclose and close of 1 day ago?? adam081527 EasyLanguage Programming 3 June 30th, 2012 01:52 PM
color bars indicator esam_jir NinjaTrader Programming 3 November 16th, 2010 04:06 AM
i am looking for median renko bars indicator dellcnu Traders Hideout 6 August 5th, 2010 08:38 PM
x sessions ago SARdynamite NinjaTrader Programming 15 July 13th, 2010 09:20 PM


All times are GMT -4. The time now is 07:08 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-18 in 0.14 seconds with 20 queries on phoenix via your IP 54.163.209.109