This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:

We work extremely hard to keep things positive on our forums.

We do not tolerate rude behavior, trolling, or vendor advertising in posts.

We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.

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, and we will never resell your private information.

yet another 'adaptation' of SW with this one you can change price factor, look back period and alpha. Disclaimer:I have no idea of what are various calculations that I cut and paste from multiple internet sources.

The following 7 users say Thank You to cory for this post:

Coding of recently posted SWave indicator was a resource hog and a general mess, so without further ado, here is a (hopefully) improved version.

You will be able to run this one on COBC false if you are so inclined, without causing your processor to explode.

Rounding reduces the amount of wasted CPU load due to calculations that go past any reasonable number of significant digits.

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

"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett

The following 8 users say Thank You to Zondor for this post:

Favorite Futures: Gameplay Klownbine® Trading of Globex

Posts: 1,276 since Jul 2009

Thanks: 1,227 given,
2,442
received

Optimized sine wave - anybody using?

Looks as though, for most instruments, rounding to only five decimal places has no effect on the output. The one exception so far is the 6J, where 7 decimal precision seems to be needed.

Which raises the question of whether the CPU cycles needed for the rounding are less than those saved by reducing the precision of the calculations. I suppose this could be answered by measuring the backfill time for different configurations and printing it to the output window, but I haven't done that.

Has anyone tested my version against Cory's to see if they plot identically? I haven't bothered to do that yet, either.

Such laziness shows why I will never become a FUNded Trader®.

Maybe we should try using JFE's new, Even BETTER Sine Wave, to paint support and resistance lines on price charts.

"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett

The following user says Thank You to Zondor for this post:

Favorite Futures: Gameplay Klownbine® Trading of Globex

Posts: 1,276 since Jul 2009

Thanks: 1,227 given,
2,442
received

Volunteer needed

Who would like to check my code and find the error? My version is not plotting correctly. So for now, don't use it.

However, I found the problem. The b2 coefficient must be calculated on every tick, AFTER Smooth[0] is known, because it is dependent on Smooth[0].

So the calculation of b2 can be left where it is, but the portion of it that depends on Smooth[0] must be stripped out of it and put into the Detrender calculation.

Another problem is that Smooth[0] does not seem to apply the correct weightings to the priceval terms. I think it should be (4*priceval[0]+3*priceval[1]+2*priceval[2]=1*priceval[3]) /10. That's why the calculation of Smooth[0] and of b1 should be changed as indicated above, and why this version does not plot identically to the one posted by @cory.

Now that I have revealed the problems, who would like to fix them? My updated version plots exactly the same as other versions of SineWave that I have seen, and loads EXTREMELY fast.

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).

"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett

Last edited by Zondor; March 12th, 2014 at 02:33 AM.

The following 3 users say Thank You to Zondor for this post: