@Pensar- I think this is pretty close, but I have a couple more questions/requests if I may. I watched another playing of the webinar and caught this slide that shows the setting he is using for the Swing Energy indicator. You can See chart here
The settings show ("b", 10, 50, 75, Green, Yellow, Red). He said there are 2 versions of this indicator- a "Buy" and a "Sell" version. I'm sure that is what the "b" is in the setting. I think the 10 is the Doncian channel length, and 50, 75 are the plotting limits to change colors.
According to the author, You should have a high fully charged value, meaning high green bars for a fully charged buy. This would require running only the "buy" version. You would also have a high fully charged value, meaning high green bars for a fully charged sell also. Is this something you can help me with? Thanks in advance.
@hockeycoachdoug Now that's a great clue. Of course, this code will not be an exact match, given that they very likely use a modified version of the donchian channel.
I think this is the the closest I can reverse-engineer it without actually seeing the other indicator's code. In all honesty, though, if their little code differences are the only key to profitable v.s. unprofitable, there's bigger problems to worry about. A quote I read once, "Those who can trade do and those who can't trade sell indicators", or something like that. Really makes one think about another saying, "there's a market for everything".Code:declare lower; input direction = {default "buy", "sell"}; input short_donchian = 10; input long_donchian = 50; input high_value = 75; input low_value = 25; input averagelength = 2; input averagetype = averagetype.SIMPLE; def hh = highest(high,long_donchian); def ll = lowest(low,short_donchian); def strength; switch (direction) { case sell: strength = movingaverage(averagetype,100*(close-ll)/(hh-ll),averagelength); default: strength = movingaverage(averagetype,100*(hh-close)/(hh-ll),averagelength); } plot RS = strength; RS.setpaintingstrategy(paintingstrategy.histogram); RS.assignvaluecolor(if rs > 75 then color.uptick else if rs > 25 then color.yellow else color.downtick); RS.setlineweight(3); plot high_strength = high_value; high_strength.setdefaultcolor(color.gray); high_strength.setpaintingstrategy(paintingstrategy.horizontal); high_strength.setstyle(curve.short_dash); plot low_strength = low_value; low_strength.setdefaultcolor(color.gray); low_strength.setpaintingstrategy(paintingstrategy.horizontal); low_strength.setstyle(curve.short_dash);
Eye-Candy of both directions -
Merry Christmas to you!
Last edited by a moderator: