Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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
Can you help answer these questions from other members on NexusFi?
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
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
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..
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
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:
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;
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
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.
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
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.