Thinkscripts - ThinkOrSwim Programming | futures io social day trading
futures io futures trading


Thinkscripts
Updated: Views / Replies:39,437 / 105
Created: by optntdr13 Attachments:31

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

Thinkscripts

  #31 (permalink)
Trading Apprentice
Chicago, IL USA
 
Futures Experience: Beginner
Platform: TOS
Favorite Futures: ES
 
Posts: 4 since Sep 2012
Thanks: 1 given, 0 received

Auto plotting time frames on TOS

RedK - thanks again for your direction. Yesterday was my first time on futures.io (formerly BMT) and am not familiar yet with the Elite portion of the site. Seems I'll need to intitiate a subscription before accessing - correct?

Regards,

Vince

Reply With Quote
 
  #32 (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

Hi Vince, that's correct.. i hope you'll find it valuable, as i did
cheers,
RedK

Reply With Quote
 
  #33 (permalink)
Elite Member
San Diego CA
 
Futures Experience: Beginner
Platform: TOS
Favorite Futures: StocKs
 
Posts: 26 since May 2012
Thanks: 14 given, 5 received



RedK View Post
i'll try to help, it looks interesting and fairly easy in ToS script. but i got lost in the thread.. if you can explain in a simple way how the counting works? i see --11235 and some dots .. so not sure what's the logic behind it and what's the signal we need to capture..

Cheers,
RedK

Here is a quote from the author of the thread to clear up the count back.

When there is a higher value bar of the CCI after a lower (be it – or +), do not count the lower value bar as one of the 5 count back bars. EX: Say the following were the value of the CCI bars: 205, 188, 161, 144, 175, 140, 160, 186, 154, 141, 101.

Counting back 1st lower bar-188, because 175 is higher than the 2 previous, ignore them; 160, ignoring 140; then we have 186 causing us to ignore 161 thru 160; 154, 141, 101. The price reversal most often takes place at the close of the 5th bar, where I would short the market, be it daily, 15 min, 5 min, or , in the TF case-377 tick. The same is the case with negative numbers, where the trade is long."

So it's a basic count back from the current CCI bar to the last high CCI bar, start counting when the CCI breaks +- 45

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

.


Last edited by pbenson68; September 18th, 2012 at 01:22 AM.
Reply With Quote
 
  #34 (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

Hi pbenson68,
got it.. we need "5 consecutive descending values" for the count to work .. otherwise we reset the count.. thought I saw the idea somewhere before..

give me some time.. in interesting scripting exercise.. will give it a shot and get back to you,
Cheers,
Red

Reply With Quote
 
  #35 (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

i gave it a shot, but don't like it

pbenson68,
i gave this a shot as promised.. in ToS i couldn't show the count on the CCI histogram .. the 1,2,3 counters can only be shown on the price (top) chart as far as i could twist the script (maybe someone else can) .. so we can have this as a top study and counts above or below the price bars/candles..

on a lower study, i could do a square like in the attached, then additionally can show an arrow up or down when the count reaches 5 ..
i'll leave the jdugement up to you if this method works .. i saw no reversals at the count but i may be looking at the wrong timeframe or instrument .. jus ttrying to help if this is useful to you..

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


let me know if that comes close to what you're looking for or i can pass you the script and you continue to play with it until you get your results.. screenshot shows how the test i did compares to the standard CCI study
cheers,
RedK

Reply With Quote
The following 2 users say Thank You to RedK for this post:
 
  #36 (permalink)
Elite Member
San Diego CA
 
Futures Experience: Beginner
Platform: TOS
Favorite Futures: StocKs
 
Posts: 26 since May 2012
Thanks: 14 given, 5 received


RedK View Post
pbenson68,
i gave this a shot as promised.. in ToS i couldn't show the count on the CCI histogram .. the 1,2,3 counters can only be shown on the price (top) chart as far as i could twist the script (maybe someone else can) .. so we can have this as a top study and counts above or below the price bars/candles..

on a lower study, i could do a square like in the attached, then additionally can show an arrow up or down when the count reaches 5 ..
i'll leave the judgment up to you if this method works .. i saw no reversals at the count but i may be looking at the wrong time frame or instrument .. just trying to help if this is useful to you..

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


let me know if that comes close to what you're looking for or i can pass you the script and you continue to play with it until you get your results.. screen shot shows how the test i did compares to the standard CCI study
cheers,
RedK

Dude that's awesome!! Very nice work.
The blocks are just as good or better. It looks like it works. I have an attempt also that actually puts numbers up but it was not working properly ( was force to rig the look for highest CCI with a fold constant, could not use a variable). I use the vertical line function to add numbers:

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


Example:
AddVerticalLine(visible = CCI < 0, text = Concat(CCInum2, ""));


Think or swim won't let me use a variable as the constant in the fold function to look for the highest bar so it would not work 100%. I can send it to you or try to work it into your working code.

This code counts bars to the positive crossover
def bar_to_neg = fold j = 1 to 15 with bar_to_neg_ID = 0 while ( CCI > 0) do if CCI[j] > 0 then bar_to_neg_ID + 1 else bar_to_neg_ID;
def k = getvalue(bar_to_neg,0);

When I use k in the fold it does not work always. It works when I to post the numbers but not when I use it to look for the Highest bar in the CCI.

example this won't work in TOS
# find High CCI
def High_CCI = fold m = 1 to k with High_CCI_temp = 0 while (CCI > 0) do if getvalue(CCI,m,0) > getvalue(CCI,m-1,0) then getvalue(CCI,m,0) else High_CCI_temp;

Reply With Quote
The following user says Thank You to pbenson68 for this post:
 
  #37 (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

Hi,
i thought fold won't be an easy route .. so i didn't go that way..
i just used a simple square signal (above or below) that counts once the bar starts decreasing..
the issue here you won't get only 5 counts, but more if the CCI value continue to decrease with no reversal .. can live with that..

it's a lot easier to build this as a "top study" that plots on the price chart, and you can then have the number counted above or below the bar, and in the color you want .. but can't do that as a lower study

then thought to also add an arrow up/down when the count reaches 5 .. that's a bit tricky
but if the square signals work for you.. i don't need to do it (at least now )

feel free to play with the code .. i attached as txt for you / code is commented. reach out if i can help further
cheers,
RedK

CCI_counter_test.txt

Reply With Quote
The following 2 users say Thank You to RedK for this post:
 
  #38 (permalink)
Elite Member
San Diego CA
 
Futures Experience: Beginner
Platform: TOS
Favorite Futures: StocKs
 
Posts: 26 since May 2012
Thanks: 14 given, 5 received


RedK View Post
Hi,
i thought fold won't be an easy route .. so i didn't go that way..
i just used a simple square signal (above or below) that counts once the bar starts decreasing..
the issue here you won't get only 5 counts, but more if the CCI value continue to decrease with no reversal .. can live with that..

it's a lot easier to build this as a "top study" that plots on the price chart, and you can then have the number counted above or below the bar, and in the color you want .. but can't do that as a lower study

then thought to also add an arrow up/down when the count reaches 5 .. that's a bit tricky
but if the square signals work for you.. i don't need to do it (at least now )

feel free to play with the code .. i attached as txt for you / code is commented. reach out if i can help further
cheers,
RedK

Attachment 89515

ok thanks, I was looking to use it as a profit taking signal so yes it will work. Did you want my ugly uncommented code?

Reply With Quote
 
  #39 (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

no code is ugly .. pls share .. we all learning

cheers, RedK

Reply With Quote
The following user says Thank You to RedK for this post:
 
  #40 (permalink)
Elite Member
San Diego CA
 
Futures Experience: Beginner
Platform: TOS
Favorite Futures: StocKs
 
Posts: 26 since May 2012
Thanks: 14 given, 5 received



RedK View Post
Hi,
i thought fold won't be an easy route .. so i didn't go that way..
i just used a simple square signal (above or below) that counts once the bar starts decreasing..
the issue here you won't get only 5 counts, but more if the CCI value continue to decrease with no reversal .. can live with that..

it's a lot easier to build this as a "top study" that plots on the price chart, and you can then have the number counted above or below the bar, and in the color you want .. but can't do that as a lower study

then thought to also add an arrow up/down when the count reaches 5 .. that's a bit tricky
but if the square signals work for you.. i don't need to do it (at least now )

feel free to play with the code .. i attached as txt for you / code is commented. reach out if i can help further
cheers,
RedK

Attachment 89515

I was playing with this tonight. I noticed 2 issues. The first was a counter issue. Let's say you have CCI values of 54 45 35 37 the counter would from 54 would go like this 45:1 35:2 then 37 is above 35 it becomes the new 2. 35 is now not included in the count.
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).


Second when the CCI breaks the +- 45 the counter should still count. I modified the counter section to read.
# Pb68 modified countup and countdown condition to zero instead, it can go below 45 line
def Count_up = CCIv > 0 and CCIv < CCIv[1];
def Count_Dn = CCIv < 0 and CCIv > CCIv[1];
#original
#def Count_up = CCIv > over_bought and CCIv < CCIv[1] ;
#def Count_Dn = CCIv < over_sold and CCIv > CCIv[1];
#original end

Here is the latest rev
CCI_counter_test_rev 09-19-2012.txt

The delimma still exists on the counter. I can't see how it can be done in the code without a fold. It's looking for a true false condition and then ploting the signalflag.

Reply With Quote

Reply



futures io > > > > > Thinkscripts

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
     


All times are GMT -4. The time now is 02:33 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-17 in 0.15 seconds with 19 queries on phoenix via your IP 54.82.56.95