Average True Range Data 2 - futures io
futures io futures trading



Average True Range Data 2


Discussion in TradeStation

Updated by happymichael21
      Top Posters
    1. looks_one Waterstreet with 2 posts (0 thanks)
    2. looks_two happymichael21 with 1 posts (0 thanks)
    3. looks_3 bobb with 1 posts (1 thanks)
    4. looks_4 manev31 with 1 posts (0 thanks)
    1. trending_up 4,332 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 4 replies
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

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

 
Search this Thread
 

Average True Range Data 2

(login for full post details)
  #1 (permalink)
Miami FL
 
 
Posts: 2 since Feb 2013
Thanks: 0 given, 0 received

i am trying to create the indicator for the ATR of data2 here is the code:

 
Code
inputs: ATRLength(14);
variables: TrueHigh2(0), TrueLow2(0),TrueRange2(0);

if Close[1]of data2 > High of data2 then
	TrueHigh2 = Close[1] of data2
else
	TrueHigh2 = High of data2  ;
	
if Close[1] of data2  < Low of data2  then 
	TrueLow2 = Close[1] of data2  
else
	TrueLow2 = Low of data2  ;
	  
TrueRange2 = TrueHigh2 - TrueLow2 ;

ATR = Average( TrueRange2, ATRLength );

but it seems to produce different results then running the ATR directly on daily bars... can anyone see anything wrong with the code?

Reply With Quote

Can you help answer these questions
from other members on futures io?
Do large speculators buy from commercials?
Traders Hideout
Where is the link to download GomiRecorder?
NinjaTrader
Horizontal Line Indicator
Platforms and Indicators
Atm strategy help
NinjaTrader
help to convert from thinkscript to ninjascript
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Legal question and need desperate help
187 thanks
Building a high-performance data system
18 thanks
FIO Journal Challenge - June 2020 w/SharkIndicators
15 thanks
Is Orderflow An Outdated Concept?
11 thanks
VWAP for stock index futures trading?
11 thanks
 
(login for full post details)
  #2 (permalink)
Miami FL
 
 
Posts: 2 since Feb 2013
Thanks: 0 given, 0 received

i see what its doing... if you apply it to a daily chart it works fine.. its because im trying to get the daily ATR using data2 that im having the problems cause of when its trying to update the indicator.

Reply With Quote
 
(login for full post details)
  #3 (permalink)
Vienna Austria
 
Experience: Intermediate
Platform: TradeStation, MultiCharts
Trading: Stocks, Forex
 
bobb's Avatar
 
Posts: 4 since Apr 2012
Thanks: 1 given, 1 received


@Waterstreet

found this in TS Forum and it works fine for me, but it's not writen for data 2 so you must adapt it.
Shows 3 different Ranges

1. previous days lookback periode
2. previous days range
3. todays range intraday ...this what you are looking for

Hope it helps

Attached Files
Register to download File Type: eld DAILY TRUE RANGE.ELD (9.7 KB, 85 views)
Reply With Quote
The following user says Thank You to bobb for this post:
 
(login for full post details)
  #4 (permalink)
Switzerland
 
Experience: Intermediate
Platform: Tradestation, Python
Trading: Forex
 
Posts: 12 since Aug 2014
Thanks: 2 given, 1 received

Hi, I was wondering if someone could help me with adding ATR data2 in this strategy:


 
Code
inputs: Price(      Close), FastLength(      50), SlowLength(    55), BuyLevel (25), ATRLength (14) ;
variables: FastAvg( 0 ), SlowAvg( 0 ), ATR( 0 ) ;

FastAvg = AverageFC( Price, FastLength ) ;
SlowAvg = AverageFC( Price, SlowLength ) ;


if CurrentBar > 1 and FastAvg crosses over SlowAvg and AvgTrueRange(data2, ATRLength ) < BuyLevel  then
{ CB > 1 check used to avoid spurious cross confirmation at CB = 1 }
	Buy ( "MA2CrossLE" ) next bar at market ;
I have tired something but it doesn't work.

Any help is appreciated

Thanks

Reply With Quote
 
(login for full post details)
  #5 (permalink)
Rocky Hill + NJ/USA
 
 
Posts: 1 since Feb 2017
Thanks: 0 given, 0 received

Waterstreet and Manev,

I created an ATR of data2 by doing this:

1) First I created a new Function called ATR_D2:

Two relevant lines are in it. The key part of the new function is calling TrueRange of data2.

inputs: Length( numericsimple ) ;

ATR_D2 = Average( TrueRange of data2, Length ) ;

2) Then from wherever you want to call the new ATR_D2 (from a strategy or function or indicator):

Inside the strategy I named a variable for the ATR for data2 and called it 'ATR_d2'.

ATR_d2 = ATR_D2 (Atr_length); // of data2

Hopefully that will work for you.

Wishing you good luck.

Reply With Quote


futures io Trading Community Platforms and Indicators TradeStation > Average True Range Data 2


February 18, 2017


Upcoming Webinars and Events
 

Getting Comfortable with Price Action Patterns w/Earn2Trade

Aug 4
 

Live Video Panel: Ask Me Anything w/Ironbeam Brokerage

Aug 6
     



Copyright © 2020 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