GMMA Oscillator Coding for TOS - ThinkOrSwim Programming | futures io social day trading
futures io futures trading

GMMA Oscillator Coding for TOS
Updated: Views / Replies:5,394 / 3
Created: by Zephyr Attachments:3

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 Search this Thread

GMMA Oscillator Coding for TOS

  #1 (permalink)
Elite Member
Nashville, TN
Trading Experience: Intermediate
Platform: TOS + NT
Broker/Data: TBD
Favorite Futures: NQ, CL, eminiRussell +
Posts: 41 since Aug 2009
Thanks: 23 given, 24 received

GMMA Oscillator Coding for TOS

Friends ....

I'm writing to ask if someone would be willing to help me finish the coding for the following GMMA Oscillator. I've found the GMMA system, combined with FIBS and the 100 WMA to be a very consistent trading method.

I've (re)coded the following GMMA Oscillator to reflect the price crossing the 100 WMA. When the color changes from RED to BLUE (and vice versa) at the 0 line, it means the price has crossed the 100 WMA - which is a signal to enter a trade. The 100 WMA frequently corresponds to the 50% FIB line when the price crosses it.

My issue is that I only get ONE multi-colored line, which doesn't reflect a cross of the Short Term MA (over or under) the Long Term MA. (See Attachment "TOS GMMA Osc").

The indicator SHOULD look like the one for Ninjatrader ... (See Attachment "NT GMMA Osc").

The following is the CODE I'm currently using in TOS. If you can help me code this properly - so it looks and operates like the one for Ninjatrader, I would be VERY GRATEFUL. I know it's something simple, but I'm missing it somehow ....

Thank you for any help you can provide!


def Short1 = (ExpAverage(Close, 3) + ExpAverage(Close, 5) +
ExpAverage(Close, 8) + ExpAverage(Close, 10) +
ExpAverage(Close, 12) + ExpAverage(Close, 15));

def Long2 = (ExpAverage(Close, 30) + ExpAverage(Close, 35) +
ExpAverage(Close, 40) + ExpAverage(Close, 45) +
ExpAverage(Close, 50) + ExpAverage(Close, 60));

plot GuppyMMAOscillator = ((Short1 - Long2) / Long2) * 100;

GuppyMMAOscillator.AssignValueColor(if Short1 < Long2 then else if Short1 > Long2 then color.BLUE else color.YELLOW);

plot ZeroLine = 0;

Attached Thumbnails
GMMA Oscillator Coding for TOS-tos-gmma-osc.png   GMMA Oscillator Coding for TOS-nt-gmma-osc.png  
Attached Files
Register to download File Type: txt NT GMMA Osc Code.txt (8.0 KB, 96 views)
Reply With Quote
The following 2 users say Thank You to Zephyr for this post:
  #2 (permalink)
Elite Member
Glyndon, Maryland, USA
Trading Experience: Advanced
Platform: TOS
Favorite Futures: options
Posts: 24 since Sep 2010
Thanks: 6 given, 48 received

From what I just read, you need an additional moving average added to the plot of the oscillator itself. You can easily do this via:

plot GuppyMMAOscillator = ((Short1 - Long2) / Long2) * 100;

change this to:
input averageType = {Simple, default Exponential, Weighted, Wilders, Hull};
input length = 13;

def GMMA = ((Short1 - Long2) / Long2) * 100;
def GMMAAvg;
switch (averagetype) {
case simple:
GMMAAvg = Average(GMMA, length);
case Exponential:
GMMAAvg = ExpAverage(GMMA, length);
case Weighted:
GMMAAvg =wma(GMMA, length);
case Wilders:
GMMAAvg = WildersAverage(GMMA, length);
case Hull:
GMMAAvg =hullMovingAvg(GMMA, length);

plot GMMAOsc = GMMA;
plot GMMAX = GMMAAvg;

To change the colors like you have above, add the same syntax to the second line of my plot. Perhaps you might consider coloring by whether or not the oscillator is above below it's average...just an idea. If you need help with the syntax, LMK.

Reply With Quote
The following 2 users say Thank You to optntdr13 for this post:
  #3 (permalink)
Elite Member
Nashville, TN
Trading Experience: Intermediate
Platform: TOS + NT
Broker/Data: TBD
Favorite Futures: NQ, CL, eminiRussell +
Posts: 41 since Aug 2009
Thanks: 23 given, 24 received

Thank you VERY MUCH, optntdr13!

It's very good of you to help with this code. I'll make the changes you've suggested.

Be well ... and thank you again ....

Reply With Quote
  #4 (permalink)
Trading Apprentice
Trading Experience: None
Platform: TD
Favorite Futures: None
Posts: 1 since Nov 2018
Thanks: 0 given, 0 received

Can someone help me with this. I can't seem to get this right. I'm trying to piece together the code for ToS previously shown but it's not working out.

Reply With Quote


futures io > > > > > GMMA Oscillator Coding for TOS

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

Benefits of Trading the Micro E-Minis w/Stage 5 & CME Group

Apr 30

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help using Awesome Oscillator as a filter protrader007 NinjaTrader Programming 19 August 30th, 2016 04:11 PM
code for NT7 volume oscillator euroventure NinjaTrader 2 December 22nd, 2010 11:42 AM
d9 Particle Oscillator Big Mike Platforms, Tools and Indicators 0 September 1st, 2010 03:35 AM
TWIGGS Oscillator for MT4... Chiantishire MetaQuotes MetaTrader MQL Programming 1 April 1st, 2010 04:26 AM
Oscillator 0 - 100 zeller4 NinjaTrader Programming 4 September 14th, 2009 08:27 AM

average, code, coding, fibonacci, gmma, hull, indicator, indicators, long term, moving average, ninja, ninjatrader, oscillator, short, short term, signal, size, think or swim, thinkorswim, thinkscript, tos, trading, trading method

All times are GMT -4. The time now is 12:17 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,
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-04-26 in 0.22 seconds with 15 queries on phoenix