Request for help on 'break" function - page 2

 

Hi Lorentzos,


I'm back again, first let me say how much I appreciate your help, truly fantastic!

Sadly the indicator you made is not doing what I want it to do, so I will try to explain as explicitly as I possibly can what I mean.

I have on my charts in M5 envelopes with period 63 and deviation 0.063.

What I want from the code in the indicator I posted is that is draws an envelope line in M5 with period 1008 and deviation xxx.

The code should determine the deviation value that belongs to the line that runs between the upper and lower envelope with period 63 and deviation 0.063.

While the difference between the two is 2 x 0.063 = 0.126 there will always be a envelope M5 period 1008 deviation STEP 0.125 that runs between the two.


I have attached the indicator that should draw that line, but is not working correctly at the moment.

 
Hmm , period 1008 will crush the terminal 
 
double DevStep,Deviation;			

 Why you use DevStep as double?

use it as integer

 

Good morning Lorentzos,


Period 1008 will not crush the terminal, provided one limits the number of candles that are loaded of each chart, one should change this number in Tools settings to a lower number i.e 10000.

As far as I know an integer can not handle decimals and double can.

 
ReactoFX:

Good morning Lorentzos,


Period 1008 will not crush the terminal, provided one limits the number of candles that are loaded of each chart, one should change this number in Tools settings to a lower number i.e 10000.

As far as I know an integer can not handle decimals and double can.

So if you change the period from 108 to 1008 your chart loads properly?

 

No, the value that meets the if-condition is not properly calculated. The line appears, but at a irrelevant level. When I change the maximum value of DevStep the line position changes, but not to the maximum value.

So it appears the break function or the calculation of the if-condition is not working properly.


I checked my code against the example over and over, but I cannot see what can be the cause of the code not working properly.

 
So in essence , when it detects a dev step that has its lines inside the M15 lines it utilizes that dev step , correct ? 

The issue then could be that the lower band is not checked against the M15 lines
 

No, that is exactly what is does not do.


I really appreciate your help, but I'm afraid we are guessing at the moment.

 
ehehehe , i mean in essence thats what the "idea" is
 
Yes, that is the idea, but although the code seems right, it does not execute right
Reason: