Dynamic Cloud - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


Dynamic Cloud
Updated: Views / Replies:751 / 6
Created: by TraderEnlight 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
 

Dynamic Cloud

  #1 (permalink)
Elite Member
Los Angeles, CA/USA
 
Futures Experience: Beginner
Platform: thinkorswim
Favorite Futures: Futures
 
TraderEnlight's Avatar
 
Posts: 12 since Aug 2014
Thanks: 3 given, 1 received

Dynamic Cloud

Hi All,

I'm trying to create a dynamic cloud in thinkorswim. The following is an illustration of what i'm trying to do. Think of aLine, bLine1, bLine2 and bLine3 as different moving averages. When aLine Crosses above one of the bLines, create a cloud between aLine and that bLine and same when aLine Crosses below one of the bLines. The Grey is the desired cloud.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


I used typical crossover code to try to accomplish this (as follows):
 
Code
def aLineplot = if aLine > bLine1 and aLine[1] <= bLine1[1] then bLine1 else if aLine > bLine2 and aLine[1] <= bLine[2] then bLine2 else if aLine > bLine3 and aLine[1] <= bLine3[1] then bLine3 else if aLine < bLine3 and aLine[1] >= bLine3[1] then aLine else if aLine < bLine2 and aLine[1] >= bLine2[1] then aLine else if aLine < bLine1 and aLine[1] >= bLine1[1] then aLine else 0;

def bLineplot =  if aLine > bLine1 and aLine[1] <= bLine1[1] then aLine else if aLine > bLine2 and aLine[1] <= bLine[2] then aLine else if aLine > bLine3 and aLine[1] <= bLine3[1] then aLine else if aLine < bLine3 and aLine[1] >= bLine3[1] then bLine3 else if aLine < bLine2 and aLine[1] >= bLine2[1] then bLIne2 else if aLine < bLine1 and aLine[1] >= bLine1[1] then bLine1 else 0;

addcloud(aLineplot,bLineplot, createcolor(153,153,153), createcolor(102,102,102));
The script doesn't give errors but it doesn't create a cloud. I did an Arrow paintingstrategy for aLinePlot and bLinePlot to see if the script is recognizing the crossovers and crossunders and thinkorswim is recognizing the crossover locations but why isn't the cloud being created?


Last edited by TraderEnlight; August 20th, 2015 at 02:09 AM.
Reply With Quote
 
  #2 (permalink)
Trading Apprentice
albuquerque nm/usa
 
Futures Experience: Intermediate
Platform: thinkorswim
Favorite Futures: forex
 
Posts: 29 since Aug 2015
Thanks: 3 given, 8 received


TraderEnlight View Post
Hi All,

I'm trying to create a dynamic cloud in thinkorswim. The following is an illustration of what i'm trying to do. Think of aLine, bLine1, bLine2 and bLine3 as different moving averages. When aLine Crosses above one of the bLines, create a cloud between aLine and that bLine and same when aLine Crosses below one of the bLines. The Grey is the desired cloud.


I used typical crossover code to try to accomplish this (as follows):
 
Code
def aLineplot = if aLine > bLine1 and aLine[1] <= bLine1[1] then bLine1 else if aLine > bLine2 and aLine[1] <= bLine[2] then bLine2 else if aLine > bLine3 and aLine[1] <= bLine3[1] then bLine3 else if aLine < bLine3 and aLine[1] >= bLine3[1] then aLine else if aLine < bLine2 and aLine[1] >= bLine2[1] then aLine else if aLine < bLine1 and aLine[1] >= bLine1[1] then aLine else 0;

def bLineplot =  if aLine > bLine1 and aLine[1] <= bLine1[1] then aLine else if aLine > bLine2 and aLine[1] <= bLine[2] then aLine else if aLine > bLine3 and aLine[1] <= bLine3[1] then aLine else if aLine < bLine3 and aLine[1] >= bLine3[1] then bLine3 else if aLine < bLine2 and aLine[1] >= bLine2[1] then bLIne2 else if aLine < bLine1 and aLine[1] >= bLine1[1] then bLine1 else 0;

addcloud(aLineplot,bLineplot, createcolor(153,153,153), createcolor(102,102,102));
The script doesn't give errors but it doesn't create a cloud. I did an Arrow paintingstrategy for aLinePlot and bLinePlot to see if the script is recognizing the crossovers and crossunders and thinkorswim is recognizing the crossover locations but why isn't the cloud being created?

For starters, you have no precedent def for "bLine" or explanation in your post for what "bLine" is, though it appears several times in your code. You only tell us what bLine1, bLine2, and bLine3 should represent. Could you maybe give us the whole code, including needed defs?

Reply With Quote
 
  #3 (permalink)
Trading Apprentice
albuquerque nm/usa
 
Futures Experience: Intermediate
Platform: thinkorswim
Favorite Futures: forex
 
Posts: 29 since Aug 2015
Thanks: 3 given, 8 received


Is this close to what you want? Your conditional arguments were pretty lengthy and made my head spin a bit so I just went with what you said in the opening text of your post. Hope I understood it right. Not sure what you wanted the code to do but this code suggests that once price breaks above the cloud it keeps going up for several periods, vice versa when breaks below the cloud.
input alineavg = 9;
input bline1avg = 5;
input bline2avg = 5;
input bline3avg = 5;
def aline = average(close,alineavg);
def bline1 = average(high,5);
def bline2 = average(low,5);
def bline3 = average(close,5);
def bline = bline1 or bline2 or bline3;;
plot P = aline;
plot Q = bline1;
plot R = bline2;
plot S = bline3;
addcloud(aLine,bLine1, createcolor(153,153,153), createcolor(102,102,102));
AddCloud(aLine,bLine2,color.red,color.red);
addcloud(aLine,bLine3,color.plum,color.plum);


EDIT: Ah, the "def bline" part is non-operative here, just a suggestion for how to handle the issue for your original code.

Reply With Quote
 
  #4 (permalink)
Elite Member
Los Angeles, CA/USA
 
Futures Experience: Beginner
Platform: thinkorswim
Favorite Futures: Futures
 
TraderEnlight's Avatar
 
Posts: 12 since Aug 2014
Thanks: 3 given, 1 received


tangerine View Post
For starters, you have no precedent def for "bLine" or explanation in your post for what "bLine" is, though it appears several times in your code. You only tell us what bLine1, bLine2, and bLine3 should represent. Could you maybe give us the whole code, including needed defs?

Thank you for responding!

For the sake of this example, i just want to assume aline, bline1, bline2, and bline3 are simple moving averages just to keep the example simple but for my actual code, aline, bline represent daily and weekly VWAP lines and the VWAP Standard Deviation lines so that's more complicated than I need to explain for what I'm trying to accomplish.

The idea is that as the aLine (a 25period simple moving average) is moving across longer period moving averages (100, 200, 800), it'll create a new cloud each time it crosses meaning the old cloud goes away.

The cloud becomes a moving, more accurate BIAS indicator. On days when Aline crosses over any Blines, there will be a new cloud between aline and bline... (addcloud, aline, bline, color.xxx, color.xxx).

But when the ALine crosses under any Blines, there will be a new cloud between bline and aline... meaning the cloud will be inverted (addcloud, bline, aline, color.xxx, color.xxx).

We can't use the addcloud function with Conditional if, then, else statements. Thinkscript doesn't like it. So the only other solution is to have only ONE addcloud function and have the two cloud variables change depending on the condition.

If anybody would like, i can send them the script... it might make more sense if you see it on a chart.

Here's some screenshots with my messy paint drawings to better describe what i'm looking for.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #5 (permalink)
Elite Member
Los Angeles, CA/USA
 
Futures Experience: Beginner
Platform: thinkorswim
Favorite Futures: Futures
 
TraderEnlight's Avatar
 
Posts: 12 since Aug 2014
Thanks: 3 given, 1 received


tangerine View Post
Is this close to what you want? Your conditional arguments were pretty lengthy and made my head spin a bit so I just went with what you said in the opening text of your post. Hope I understood it right. Not sure what you wanted the code to do but this code suggests that once price breaks above the cloud it keeps going up for several periods, vice versa when breaks below the cloud.
input alineavg = 9;
input bline1avg = 5;
input bline2avg = 5;
input bline3avg = 5;
def aline = average(close,alineavg);
def bline1 = average(high,5);
def bline2 = average(low,5);
def bline3 = average(close,5);
def bline = bline1 or bline2 or bline3;;
plot P = aline;
plot Q = bline1;
plot R = bline2;
plot S = bline3;
addcloud(aLine,bLine1, createcolor(153,153,153), createcolor(102,102,102));
AddCloud(aLine,bLine2,color.red,color.red);
addcloud(aLine,bLine3,color.plum,color.plum);


EDIT: Ah, the "def bline" part is non-operative here, just a suggestion for how to handle the issue for your original code.

Hi, Thank you for responding!

Your code is close! What we would get with the 3 addcloud functions you use would look a little like this:

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
albuquerque nm/usa
 
Futures Experience: Intermediate
Platform: thinkorswim
Favorite Futures: forex
 
Posts: 29 since Aug 2015
Thanks: 3 given, 8 received


TraderEnlight View Post
Hi, Thank you for responding!

Your code is close! What we would get with the 3 addcloud functions you use would look a little like this:

...

Yes, it does. And I think what you're saying is that you want a single, discontinuous cloud? So, for example, the cloud from a cross of aline/bline1 disappears when cross of aline/bline2 occurs. Hmm, seems to me that could be written into the plots of PQRS. That way, you avoid the problem of TOS not liking conditionals in Cloud string per se. Would that work?

Reply With Quote
 
  #7 (permalink)
Elite Member
Los Angeles, CA/USA
 
Futures Experience: Beginner
Platform: thinkorswim
Favorite Futures: Futures
 
TraderEnlight's Avatar
 
Posts: 12 since Aug 2014
Thanks: 3 given, 1 received


tangerine View Post
Yes, it does. And I think what you're saying is that you want a single, discontinuous cloud? So, for example, the cloud from a cross of aline/bline1 disappears when cross of aline/bline2 occurs. Hmm, seems to me that could be written into the plots of PQRS. That way, you avoid the problem of TOS not liking conditionals in Cloud string per se. Would that work?

Yes, I was trying to write them into the plots with those 2 big define statements. I was using crossover and crossunder logic... a.k.a if aline > bline and aline[1] <= bline[1] then aline else... but that only seems to pinpoints the exact area of the occurring crossover.

There has to be a way to do this...

Reply With Quote

Reply



futures io > > > > > Dynamic Cloud

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
trading in the cloud PandaWarrior Traders Hideout 5 September 30th, 2016 06:34 PM
EMA Cloud for Ninjatrader stevew18 NinjaTrader Programming 4 March 17th, 2014 01:05 AM
CCI Cloud trendfriendpa ThinkOrSwim 2 April 8th, 2013 01:48 AM
Ollie's Cloud Formations ollie Trading Journals 27 February 12th, 2013 09:13 PM
Looking to setup my own cloud Traderji Tech Support 14 March 22nd, 2012 09:59 PM


All times are GMT -4. The time now is 07:30 AM.

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-16 in 0.17 seconds with 19 queries on phoenix via your IP 54.226.113.250