HELP, Completely Baffled by this Indicator

 

Hi Guys,

I'm completely baffled by the logic of this indicator. Have ran out of ideas on how to solve the issues listed below. I reversed the CI_Buy and CI_Sell output values as I wanted a 1 for a long and -1 for a short trend tag sent to the Global Variables (GV). This makes it easier to do a quick read of the GV.

After studying the Cycle Identifier there are some quirks that need to be fixed. I have read all about how this indicator repaints too much. Almost all indicators repaint. The main problem here was that the length input was set to 3 when looking at the settings used on all of the different blogs. Far, far too fast. Changing the length to 8 or greater, depending on your trading style, enhances its accuracy. The Cycle Identifier must still be used with other supporting indicators.

The confusing part is that the paint output is much more accurate than the value sent to the GV. Paint and the GV value do not always match.

Two items that need repair;

1 - Did not want a zero value sent to the GV so I inserted the following code toward the end of the indicator.

if (CI_Buy[pos] == -1)

{

CI = 1;

}

if (CI_Sell[pos] == 1)

{

CI = -1;

}

LineBuffer[pos] = 0;

//CI_Buy[pos] = 0;

//CI_Sell[pos] = 0;

}

if (CI != 0)

{

GlobalVariableSet (Global_CI_string, CI);

}

Now upon system reboot or restarting MT4 the CI seems to want to default always to a 1. That is unless a short trend has started only a few candles back then the value is correct at -1. If the trend change is not within a few candles then it always defaults to 1. Would like it to look back to the last paint and have that corresponding color be the value sent to the GV. Because of this you must manually go into the GV and change the value where in error, if it will hold the new value inputted into the GV. Doesn't seem like much but, when trading 20 currency pairs it can be a hassle or a problem if the market is moving fast. Due to my MT4 configuration I must reboot at least 2 times a day due to memory allocation issues with the MT4 platform. If I don't the platform freezes. Have solved part of this problem by opening 10 platforms with 2 currency pairs per with the same account number. And have reduced the number of candles in history and to be displayed to 500.

2 - Is a continuation of 1. Need the value of the trend to match that of the paint and hold it until the indicator repaints to the opposite color (green 1 & red -1). The paint output is far more accurate then the numerical value sent to the GV. What seems to happen is the CI will paint and a coinciding value is sent to the GV or a value is sent before or after it paints. When the price moves a certain amount from that of the price value of when the paint did strike, it's not a whole lot and the amount varies, the GV value is reversed even though it has not repainted, as there is no opposite trend color sent to the display. The GV value needs to hold the corresponding paint color value until it repaints a different color.

Your help would be greatly appreciated.

Just Stumped

mperk

Files:
Reason: