MA_Slope - Reverse engineering

 

THE PROBLEM:
 I've got an idicator in compiled version only and I'm trying to figure out how to implement it in my EA. 

IDEAS:
- figure out how my EA could read the color of the chart.
- iCustom returns the value of the indicator, not the color, and it is the color that I need 

- "reverse engineer" the indicator and have it in .mq4
- indicator's line is simply an EMA
- color changes depend on the slope of a trend but it doesn't seem to be calculated in a very straight forward manner, ie. there are instances where it's sloping upwards, and it remains red
- the blue part is a mistery, it is calculated with the use of 'slope' paramater. Apparently it's a variable making it more or less sensitive to a trend. 
- setting the slope parameter to 0, 1, 100, and checking different timeframes didn't help me to figure it out 

The indicator comes from babypips, but the author doesn't seem to be active anymore...

 
Any ideas will be much appreciated.

  

 

Files:
maslope.ex4  3 kb
 

If the indi has three colors it must have at least three buffers in the terminal's data window. This important thing is not part or your screenshot :(

Normally use iCustom(...., bufferIndex, shift);

You don't need a reverse engineering just put an ema on the screen and change its parameter until it fits

 

create first fuffer that will draw line than add yours buffer.

Or whentrend chages set on bar of change price to 1-st and 2-nd buffer. 

 
gooly:

If the indi has three colors it must have at least three buffers in the terminal's data window. This important thing is not part or your screenshot :(

Normally use iCustom(...., bufferIndex, shift);

You don't need a reverse engineering just put an ema on the screen and change its parameter until it fits


I actually did exactly that. I put EMA and it was exactly flush with MASlope, but it didn't solve my problem.


Perhaps I'm missing something. Is there a way for iCustom to return which of the buffers it's displaying - 0,1,2 in this particular case? I can get the values of buffers, but they don't differ significantly enough for me to know which one is which.

 

1) Look at the Data Window of the terminal the topmost value of this indicator is index 0.

2) Open the indicators property and look for the color tabs there you see as well 0,1,2,....

 

     

 I got it! I have no idea why I didn't see it before. Thank you guys!

 

      if ((iCustom(Symbol(),0,"maslope",26,3.25,0,0) <=1))
      {
         //buf 1
      }
      if ((iCustom(Symbol(),0,"maslope",26,3.25,1,0) <=1))
      {
         //buf 2
      }
      if ((iCustom(Symbol(),0,"maslope",26,3.25,2,0) <=1))
      {
         //buf 3
      }
 
 if ((iCustom(Symbol(),0,"maslope",26,3.25,0,0) <=1))

 //More likely

 if ((iCustom(Symbol(),0,"maslope",26,3.25,0,0) !=EMPTY_VALUE))

you may have problems if the symbol's price is more than 1 with your code

Reason: