Interpreting the Logic from this Indicator.

 

Here is an indicator I am trying to use in my EA.

I defined the buffers of it but now not understanding what logic were used for Buy/Sell Signals.

I defined the first three buffers like this:

double Buf_0 = iCustom(NULL,0,"xpMA",MA_Period,MA_Type,MA_Applied ,T3MA_VolumeFactor,JMA_Phase,Step_Period,DebugMode,0,0); 
double Buf_1 = iCustom(NULL,0,"xpMA",MA_Period,MA_Type,MA_Applied ,T3MA_VolumeFactor,JMA_Phase,Step_Period,DebugMode,0,1); 
double Buf_2 = iCustom(NULL,0,"xpMA",MA_Period,MA_Type,MA_Applied ,T3MA_VolumeFactor,JMA_Phase,Step_Period,DebugMode,0,2);

Now how to compare them to get the signal like the MA is giving?

When this MA gives 'Buy' signal the 4th buffer becomes '1', and when it gives 'Sell' signal it becomes '-1'.

Can I directly use it as the signal? So far I seen that this indi doesn't 'Repaint' that much.

So I want to keep the 'Non-Repainting' characteristic as well.

Any kind suggestion will really be Helpful.

Regards

Files:
xpma.mq4  21 kb
 
Arav007:

Here is an indicator I am trying to use in my EA.

I defined the buffers of it but now not understanding what logic were used for Buy/Sell Signals.

I defined the first three buffers like this:

Now how to compare them to get the signal like the MA is giving?

When this MA gives 'Buy' signal the 4th buffer becomes '1', and when it gives 'Sell' signal it becomes '-1'.

Can I directly use it as the signal? So far I seen that this indi doesn't 'Repaint' that much.

So I want to keep the 'Non-Repainting' characteristic as well.

Any kind suggestion will really be Helpful.

Regards


That attached file is not the indicator it is more like half indicator half EA

the way you read buffers with iCustom is also wrong done

attach your original indicator on a chart

View Data Window Ctrl+D

if you run with the mouse over the bars you can read the value(s) of the indicator in the Data Window

Check what values Buf_0,.......... you are calculating

It 's time for you start learning with more simple programs

 
Arav007:

Here is an indicator I am trying to use in my EA.

I defined the buffers of it but now not understanding what logic were used for Buy/Sell Signals.

I defined the first three buffers like this:

Now how to compare them to get the signal like the MA is giving?

When this MA gives 'Buy' signal the 4th buffer becomes '1', and when it gives 'Sell' signal it becomes '-1'.

Can I directly use it as the signal? So far I seen that this indi doesn't 'Repaint' that much.

So I want to keep the 'Non-Repainting' characteristic as well.

Any kind suggestion will really be Helpful.

Regards


You don't need to check all the buffers. Only the 4th buffer which gives the Buy/Sell/No Signal.

I need to update xpMA indicator to build 6xx too. I'll inform u when this done.

 
deVries:


That attached file is not the indicator it is more like half indicator half EA

the way you read buffers with iCustom is also wrong done

attach your original indicator on a chart

View Data Window Ctrl+D

if you run with the mouse over the bars you can read the value(s) of the indicator in the Data Window

Check what values Buf_0,.......... you are calculating

It 's time for you start learning with more simple programs


Actually I have got that indicator from Codersguru's Thread at FF.

So not sure about the 'Original' indicator. If you have that one, please share.

I have defined buffers for another set of custom indicators before and that

worked fine. This time I followed the same way.

Would you please point where I made the mistake this time?

Thanks

 
Arav007:


Actually I have got that indicator from Codersguru's Thread at FF.

So not sure about the 'Original' indicator. If you have that one, please share.

I have defined buffers for another set of custom indicators before and that

worked fine. This time I followed the same way.

Would you please point where I made the mistake this time?

Thanks


in the "indicator" you attached there are lot of trading functions you can't have in an indicator

check the file you attached

you don't learn how to code correctly

if you past codes from other programs this way in your own program

. how can you understand this way "your code"

so it's not the original xpMA indicator

you said I defined the first three buffers like this:

double Buf_0 = iCustom(NULL,0,"xpMA",MA_Period,MA_Type,MA_Applied ,T3MA_VolumeFactor,JMA_Phase,Step_Period,DebugMode,0,0); 
double Buf_1 = iCustom(NULL,0,"xpMA",MA_Period,MA_Type,MA_Applied ,T3MA_VolumeFactor,JMA_Phase,Step_Period,DebugMode,0,1); 
double Buf_2 = iCustom(NULL,0,"xpMA",MA_Period,MA_Type,MA_Applied ,T3MA_VolumeFactor,JMA_Phase,Step_Period,DebugMode,0,2);

This way you get only the value of first buffer 0 at bar 0, 1, and 2

If you are opening Data Window like i suggested you will understand my message https://www.mql5.com/en/forum/150755

 
deVries:


in the "indicator" you attached there are lot of trading functions you can't have in an indicator

check the file you attached

you don't learn how to code correctly

if you past codes from other programs this way in your own program

. how can you understand this way "your code"

so it's not the original xpMA indicator

you said I defined the first three buffers like this:

This way you get only the value of first buffer 0 at bar 0, 1, and 2

If you are opening Data Window like i suggested you will understand my message https://www.mql5.com/en/forum/150755


ohh, Sorry, I just messed it up with the buffer and bar numbers.

Yes, it has to be 0,1,2 for three buffers and 0,0,0 for the result of current bars of those buffers. I did it right before:

Buf_0 = iCustom(NULL,0,"MoneyFlowIndex",EarlySignal_MFI,M3_Coral_Filter_MFI,0,0);
Buf_1 = iCustom(NULL,0,"MoneyFlowIndex",EarlySignal_MFI,M3_Coral_Filter_MFI,1,0);
Buf_2 = iCustom(NULL,0,"MoneyFlowIndex",EarlySignal_MFI,M3_Coral_Filter_MFI,2,0);

Yes, I opened the Data Window and got the idea that there are 4 buffers which I stated at the OP.

But now I think as Codersguru said, I have to use the 4th buffer only for getting the 'Buy/Signal' signal.

 double Buf_4 = iCustom(NULL,0,"xpMA",MA_Period,MA_Type,MA_Applied ,T3MA_VolumeFactor,JMA_Phase,Step_Period,DebugMode,3,0); 
 
codersguru:

You don't need to check all the buffers. Only the 4th buffer which gives the Buy/Sell/No Signal.

I need to update xpMA indicator to build 6xx too. I'll inform u when this done.




Tried with the 4th Buffer at Build 509 (with which these Indicators are compatible) but still it's not taking any trade as like the 'xpMAEA'!

Not understanding why?

Files:
xp.mq4  5 kb