plotting the difference between two moving averages as a lower study in ToS - ThinkOrSwim | futures io social day trading
futures io futures trading


plotting the difference between two moving averages as a lower study in ToS
Updated: Views / Replies:2,305 / 6
Created: by StephenAndersen 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 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
 
Thread Tools Search this Thread
 

plotting the difference between two moving averages as a lower study in ToS

  #1 (permalink)
Trading Apprentice
Wilton, CT U.S.A.
 
Futures Experience: Intermediate
Platform: ThinkOrSwim
Favorite Futures: ES
 
Posts: 6 since Mar 2013
Thanks: 1 given, 0 received

plotting the difference between two moving averages as a lower study in ToS

Does anyone know how to take the difference between a 7 period SMA and 1 period SMA and plot it as an oscillator in a separate frame on ToS? Any help would be greatly appreciated.

Reply With Quote
 
  #2 (permalink)
Knowledge Seeker
Dubai, UAE
 
Futures Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Futures: Stocks & Basic Options
 
RedK's Avatar
 
Posts: 171 since May 2012
Thanks: 44 given, 138 received

try this....

Hi, 1 period SMA is in reality the price itself, say close.. so i'll add the option to input (in study settings) a fast and slow periods.. if you like still to use 1 for fast, that would be ok
also added the choice to input which price to use (close, HL2, HLC3,...etc)

so your code should look like this (from memory, I didn't try it but should work, if you copy/paste in a new study in ToS) ..

also this will produce a non-restricted oscillator .. so no high/low limits for where it can go.. similar to MACD basically .. if we need to restrict it, we may think of relating it to the highest/lowest values for a certain timeframe and they become the 100% limits (like a stochastic) .. does that help?

 
Code
declare lower;
Input price = close;
Input Fast = 1;
Input Slow = 7;
def FastSMA = Average(Price, Fast);
def SlowSMA = Average(price, Slow);
plot Diff = FastSMA - SlowSMA;


Last edited by RedK; March 23rd, 2013 at 06:21 AM. Reason: fixed a code syntax
Reply With Quote
The following 3 users say Thank You to RedK for this post:
 
  #3 (permalink)
Trading Apprentice
toronto
 
Futures Experience: Beginner
Platform: ToS
Favorite Futures: stocks
 
Posts: 1 since Jun 2014
Thanks: 1 given, 0 received

Follow up question


I used that it was very helpful thanks
i have that set up and i threw in a zero line too
but i wanna but a boolean or something to show the cross over and under the zero line
...is there any way to do that?

Reply With Quote
 
  #4 (permalink)
Knowledge Seeker
Dubai, UAE
 
Futures Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Futures: Stocks & Basic Options
 
RedK's Avatar
 
Posts: 171 since May 2012
Thanks: 44 given, 138 received

@xaifax, this would be a straight forward thing to do in ToS - we even have few options to how to display that signal to help a quality trade decision:
1 - can draw a vertical line when it happens, and change the color (red/green) based on the crossing direction
2 - can use an Arrow up/down on the lower study when the crossing happen
3 - can show that arrow up/down signal (or any other type of signal basically) on the price chart itself - there's a trick here, the upper study will need to be a separate one that does the calculation in the background but only plots the signal. it's up to you to ensure both that upper signal study and the lower one are in sync in terms of settings. then this becomes a regular MA crossing signal study (which I think is already built-in in ToS)
4 - other ideas .. audible alerts, display a study label that says "crossing-up" or "long" or something like that,

if you have a preference from above (or other ideas) and need help coding it, i'll be glad to help,
K

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: Intermediate
Platform: Thinkorswim
Favorite Futures: Stocks
 
Posts: 4 since Mar 2015
Thanks: 1 given, 0 received

Hi all,

Sorry to hijack this thread temporarily.

I want to plot a lower study that shows the difference between close price and its 50days Moving Average in an oscillator fashion (similar to RSI).

How do I go about doing it?

Reply With Quote
 
  #6 (permalink)
Knowledge Seeker
Dubai, UAE
 
Futures Experience: Intermediate
Platform: TOS, TradeStation
Broker/Data: OX, TradeStation
Favorite Futures: Stocks & Basic Options
 
RedK's Avatar
 
Posts: 171 since May 2012
Thanks: 44 given, 138 received


JTun View Post
Hi all,

Sorry to hijack this thread temporarily.

I want to plot a lower study that shows the difference between close price and its 50days Moving Average in an oscillator fashion (similar to RSI).

How do I go about doing it?

you can use a MACD with settings of 1 and 50 and 1 - i'm doing this from memory but I think that should give you what you're looking for if i'm not mistaken,

Cheers,
K

Reply With Quote
The following user says Thank You to RedK for this post:
 
  #7 (permalink)
Trading Apprentice
Singapore
 
Futures Experience: Intermediate
Platform: Thinkorswim
Favorite Futures: Stocks
 
Posts: 4 since Mar 2015
Thanks: 1 given, 0 received

Thanks K.

I sorted out what I wanted with a zero line, much like what TS has done.

Cheers =)

Reply With Quote

Reply



futures io > > > > plotting the difference between two moving averages as a lower study in ToS

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
Simple Moving Average difference NINJA and TOS optionzen NinjaTrader 9 January 29th, 2015 05:33 PM
Moving Averages - How do you use them? Fat Tails The Elite Circle 152 October 1st, 2012 05:23 PM
The Big Money's Moving Averages RODLM The Elite Circle 1 June 6th, 2010 04:29 PM
Moving averages yiman Traders Hideout 9 January 28th, 2010 11:19 AM
Indicator For Area Between Two Moving Averages adrian Traders Hideout 14 October 6th, 2009 05:49 PM


All times are GMT -4. The time now is 01:05 PM.

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.12 seconds with 19 queries on phoenix via your IP 54.196.201.241