Coding help... Cyclical indicator - page 5

 

engula

The 2.01 calls the 1.01. Their values are very different and if they were combined into one, you would see one almost horizontal line (the 2.01) and one normal line (1.01) so they can not be combined normally into one simply because they have too different values. See the example how it would look like

engula:
sorry, i'm not sure if i understand, my bad... my wish was to have the 2 indis combined into 1, but i see that you modified them both. or did i misunderstand sth?
Files:
cl.gif  32 kb
 
mladen:
engula

The 2.01 calls the 1.01. Their values are very different and if they were combined into one, you would see one almost horizontal line (the 2.01) and one normal line (1.01) so they can not be combined normally into one simply because they have too different values. See the example how it would look like

mladen, now i understand what you mean. my mistake because i wasn't clear enough in my original request...

what i want to show on the graph is only slope2.

attached how it should look like with parameters 16 and 64. but to have this result, i have to:

- hardcode into slope these parameters,

- rename the slope indi,

- hardcode into slope2 the renamed slope indi, and

- attach slope2 to the graph.

i've attached as an example the resulting graph and the 2 indis.

based on this, do you think the 2 indis can be combined into one? thanks.

cl_slope_16-64.mq4

cl_slope2_16-64.mq4

Files:
 

engula

Here you go

What the rest (unfamiliar with the indicator) must know that SnakeSMA is actually centered TMA and that it will recalculate values of last HalfCycle1 or HalfCycle2 (whichever is greater). Other than that, this is now a standalone indicator (it does not require any other indicator)

engula:
mladen, now i understand what you mean. my mistake because i wasn't clear enough in my original request...

what i want to show on the graph is only slope2.

attached how it should look like with parameters 16 and 64. but to have this result, i have to:

- hardcode into slope these parameters,

- rename the slope indi,

- hardcode into slope2 the renamed slope indi, and

- attach slope2 to the graph.

i've attached as an example the resulting graph and the 2 indis.

based on this, do you think the 2 indis can be combined into one? thanks.

cl_slope_16-64.mq4

cl_slope2_16-64.mq4
Files:
 
mladen:
engula

Here you go

What the rest (unfamiliar with the indicator) must know that SnakeSMA is actually centered TMA and that it will recalculate values of last HalfCycle1 or HalfCycle2 (whichever is greater). Other than that, this is now a standalone indicator (it does not require any other indicator)

great mladen!

sorry i couldn't explain myself better from the beginning. i'll test the indi this evening and let you know. regards.

 
mladen:
engula

Here you go

What the rest (unfamiliar with the indicator) must know that SnakeSMA is actually centered TMA and that it will recalculate values of last HalfCycle1 or HalfCycle2 (whichever is greater). Other than that, this is now a standalone indicator (it does not require any other indicator)

mladen,

your indi works like expected, many thanks.

one last question: how can i modify the code in order to have the 2 parameters displayed after the indi name in the subwindow?

Files:
untitled.jpg  11 kb
 
engula:
mladen,

your indi works like expected, many thanks.

one last question: how can i modify the code in order to have the 2 parameters displayed after the indi name in the subwindow?

Hi Engula,

In the init() part of the code under your buffers and above return(0)} you can add this

IndicatorShortName("CL Slope3("+HalfCycle1+","+HalfCycle2+")");

 
lucmat:
Dear Mladen

I'm desperate!

Why this great indicator that you created in the last bar is different from the one I created in excel?

There must be a solution ....

Thanks

Dear Mladen

Maybe I understand why the indicator that you've created behaves differently from that in excel in the last period (that is the period in which it makes the prediction: in the previous period they are identical).

In excel there are not only centered moving averages of the price, but also of other lines (in the excel sheet are indicated in column "D", "F", "H"). The difference may depend on the fact that the indicator in mq4 reuses the last (current) value "only of the price", while not projecting forward also the value of these other lines (in the indicator mq4 should be lines that calculate "work [3]", "work [5]", "work" [7]).

Could you tell me whether it is a right way?

Thanks

Lucmat

 
lucmat:
Dear Mladen

Maybe I understand why the indicator that you've created behaves differently from that in excel in the last period (that is the period in which it makes the prediction: in the previous period they are identical).

In excel there are not only centered moving averages of the price, but also of other lines (in the excel sheet are indicated in column "D", "F", "H"). The difference may depend on the fact that the indicator in mq4 reuses the last (current) value "only of the price", while not projecting forward also the value of these other lines (in the indicator mq4 should be lines that calculate "work [3]", "work [5]", "work" [7]).

Could you tell me whether it is a right way?

Thanks

Lucmat

So, am I in a right way or say a stupid thing?

Thanks

Lucmat

 

Hi lucmat, I'm also looking this indicator, but Slop3 is very similar to "Velocità Centrata" (i'm italian too).

blue line= min

yellow line = max

For which cycle your setting is 16,64? ciao

Files:
prova.png  49 kb
 

lucmat

You should check the exact formula what does excel exactly include in calculation. If they use same data and they calculate the same way, they should work OK.

PS: as far as "should be lines that calculate "work [3]", "work [5]", "work" [7]" part is concerned - no, everything is fie as far as mql is concerned - take a look at how data is stored in "work" array and it will be clear what is done and how it is calculated.

lucmat:
Dear Mladen

Maybe I understand why the indicator that you've created behaves differently from that in excel in the last period (that is the period in which it makes the prediction: in the previous period they are identical).

In excel there are not only centered moving averages of the price, but also of other lines (in the excel sheet are indicated in column "D", "F", "H"). The difference may depend on the fact that the indicator in mq4 reuses the last (current) value "only of the price", while not projecting forward also the value of these other lines (in the indicator mq4 should be lines that calculate "work [3]", "work [5]", "work" [7]).

Could you tell me whether it is a right way?

Thanks

Lucmat