Custom field in the SCN for ATR for SPX - ThinkOrSwim | futures io social day trading
futures io futures trading


Custom field in the SCN for ATR for SPX
Updated: Views / Replies:201 / 3
Created: by sunilnpendse 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 100,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

 
 
Thread Tools
 

Custom field in the SCN for ATR for SPX

 
SunnyTheTrader
Cypress Tx
 
Trading Experience: Intermediate
Platform: NinjaTrader ThinkorSwim
Favorite Futures: Stock Futures
 
Posts: 3 since Sep 2016
Thanks: 2 given, 0 received

Custom field in the SCN for ATR for SPX

Hi all, I am new to coding on Think or swim. But trying to create a scan for stocks. I have got hand of how to create scan and add filters for stocks, studies. But I need another filter where I need to add ATR value for SPX into my scan. How do I add a custom field that will show ATR value of SPX?

I have tried below code but it does not calculate for SPX?

input symbol = "SPX";
declare upper;
input length = 9;

input price = close;
input ATR_Length = 14;
input Show_Labels = yes;
def ATR = hullMovingAvg(TrueRange(high(period = AggregationPeriod.DAY)[0], close(period = AggregationPeriod.DAY)[0], low(period = AggregationPeriod.DAY)[0]), ATR_Length);
#Def ATRRatio = ATR/100;
AddLabel(yes, AsText((ATR) / 100, NumberFormat.Three_DECIMAL_PLACES));
#plot myindicator = ATRRatio;

Please advice,
Thanks...Sunny

 
 
Trading Apprentice
Novosibirsk, Russia
 
Trading Experience: Beginner
Platform: ThinkOrSwim, IB's TWS
Broker/Data: Interactive Brokers
Favorite Futures: Options
 
Posts: 11 since Apr 2018
Thanks: 6 given, 4 received

Answer
This post has been selected as an answer to the original posters question Answer

it should work

def ATR = hullMovingAvg(TrueRange(high(period = AggregationPeriod.DAY, symbol = symbol)[0], close(period = AggregationPeriod.DAY, symbol = symbol)[0], low(period = AggregationPeriod.DAY, symbol = symbol)), ATR_Length);

The following user says Thank You to AnyDozer for this post:
 
 
SunnyTheTrader
Cypress Tx
 
Trading Experience: Intermediate
Platform: NinjaTrader ThinkorSwim
Favorite Futures: Stock Futures
 
Posts: 3 since Sep 2016
Thanks: 2 given, 0 received


AnyDozer - Thanks a lot. Your answer helped me solve ATR calculation issue. But my code below is not taking CLOSE of SPX. It is selecting CLOSE of security in the line this is being calculated in the SCAN.

How do I select CLOSE of SPX?

 
 
Trading Apprentice
Novosibirsk, Russia
 
Trading Experience: Beginner
Platform: ThinkOrSwim, IB's TWS
Broker/Data: Interactive Brokers
Favorite Futures: Options
 
Posts: 11 since Apr 2018
Thanks: 6 given, 4 received

input symbol = "SPX";
def price = close(symbol = symbol);

The following user says Thank You to AnyDozer for this post:

 



futures io > > > > Custom field in the SCN for ATR for SPX
Thread Tools



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

Day Trading Oil Futures: Reducing Risk & Increasing Profits w/DTN IQFeed

Mar 26
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Jim Dalton's Field of Vision & His Books sysot1t Trading Reviews and Vendors 33 March 9th, 2019 01:30 PM
Prog. for SPY Atr vs. Atr of all stocks in tradestation Inventor TradeStation 2 November 27th, 2014 10:24 AM
Market Profile - Field Of Vision KumoAssasin Traders Hideout 8 August 14th, 2014 04:28 AM
Gushers highlight potential of Pa. gas field kbit Commodities Futures Trading 5 June 28th, 2011 09:00 AM
Ninajtrader: OrderId as BLOB in field userdata richtobey The Elite Circle 2 May 4th, 2011 11:36 AM


Tags
atr, code, coding, how to, scan, sp, spx, stocks, think or swim, thinkorswim, tos

All times are GMT -4. The time now is 03:22 AM. (this page content is cached, log in for real-time version)

Copyright © 2019 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432 WhatsApp Business, 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 2019-03-23 in 0.19 seconds with 22 queries on phoenix