Take ATR value from specific day - futures io
futures io futures trading



Take ATR value from specific day


Discussion in EasyLanguage Programming

Updated by Quick Summary
    1. trending_up 900 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 replies
    2. attach_file 0 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
 

Take ATR value from specific day

(login for full post details)
  #1 (permalink)
Sydney, NSW
 
Experience: Beginner
Platform: MultiCharts
Trading: Stocks
 
Posts: 3 since Feb 2015
Thanks: 1 given, 0 received

Hi fellow traders,

I have a very specific issue to solve - I would like to take the ATR value (measured over 10 day length) from a specific day.

I trade daily bars, Aus Stocks, this is for an ATR Trailing Exit from a long position.

Here is the code (If anyone thinks that this is not a strict trail (ie, only trails up, does not trail down), please let me know. I think I have coded it right but you never know).

 
Code
Inputs: TrailingATRs(4), ATRLength(10);

Var: PosHigh(0);
Var: ATRVal(0);

ATRVal = AvgTrueRange(ATRLength) * TrailingATRs;

If MarketPosition = 1 Then Begin
If BarsSinceEntry = 0 Then
	PosHigh = High - ATRVal;
If (High - ATRVal) > PosHigh Then
	PosHigh = High - ATRVal;
If High < PosHigh then
Sell ( "ATRtrail" ) Next Bar at PosHigh or lower ;

End;
The issue is I want ATRval to be taken from the day that the highest high occured. At the moment it does not seem to be doing that.

Thank you in advance for any help!

Reply With Quote

Can you help answer these questions
from other members on futures io?
help to convert from thinkscript to ninjascript
NinjaTrader
T​​​​​​radestation datafeed (real time and historical) to NT8
NinjaTrader
Horizontal Line Indicator
Platforms and Indicators
OPEN_CLOSE_DOTS
ThinkOrSwim
Times and Sales more data to be displayed
TradeStation
 


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Take ATR value from specific day


August 20, 2015


Upcoming Webinars and Events
     



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