Displaying CCI indicator overbought/oversold levels
Author: SBondorowicz
Creation Date: 10/18/2009 9:38 AM
profile picture

SBondorowicz

#1
Title of post is misleading but there doesn't seem to be any way of editing the title!

What I am trying to do is colour the price pane dependent on the CCI having been x bars under/over the overbought/oversold levels. Apart from maintaining a running total is there a function which will return the number of bars a data series as been above/below a certain value?
profile picture

Eugene

#2
Sure, this is still a 'running total', already available in Community.Indicators.

For your case i.e. "series above/below some value for N bars":

CrossOverValueBar
CrossUnderValueBar

In addition, for "series above/below other series for N bars":

Series Is Above
Series Is Below
profile picture

SBondorowicz

#3
Thanks. I had looked in Standard Indicators but I keep forgetting that information about the various functions available are listed in different places.

When I said running total I was thinking that maintaining a couple of count variables within the bars loop would be much slower than calling a compiled function, is that correct? I was thinking of compiling a couple of my slower strategies into a dll but if the speed improvement over a straight script is negligible then there probably isn't much point.
profile picture

Eugene

#4
QUOTE:
I was thinking that maintaining a couple of count variables within the bars loop would be much slower than calling a compiled function, is that correct?

No speed penalty here. WealthScript code is no longer interpreted, so editor-based and compiled strategies are on par. (Maybe a couple of milliseconds to compile the code for the first time, but that's all.)
profile picture

SBondorowicz

#5
Thanks for the information. In that case you have saved me a couple of days work porting the scripts over to SharpDevelop. I prefer working in WealthLab's script editor and if you ever manage to get rid of the disappearing cursor bug and provide an integrated debugger it will be the ideal development environment.
profile picture

Eugene

#6
Alas, no plans for integrated debugger. SharpDevelop and Visual Studio can't be beat - they have excellent debuggers.

Re: cursor bug - does temporarily switching to another app via Alt-Tab and back help? This most likely is an issue with 3rd party component (Qwhale Editor .NET.)
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).