Jump to content

Good Indicator Need small fix


mograst

Recommended Posts

Re: Good Indicator Need small fix

 

A much smaller and better version

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Black
#property indicator_color3 Blue
#property indicator_color4 Black

double buf0[];
double buf1[];
double buf2[];
double buf3[];
extern int Rperiod = 18;
extern int LSMA_Period = 20;
int AllBars;
int bar;
int r;
int CBars;
int Last;
double rofs;
double rsum;

int init() {
  IndicatorBuffers(7);
  SetIndexBuffer(0, buf0);
  SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 1);
  SetIndexBuffer(1, buf1);
  SetIndexStyle(1, DRAW_NONE);
  SetIndexBuffer(2, buf2);
  SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 1);
  SetIndexBuffer(3, buf3);
  SetIndexStyle(3, DRAW_NONE);
  return (0);
}

int start() {
  if (Last==0) 
    CBars = Bars - 6 - 2*Rperiod;
  else
    CBars = iBarShift(NULL,0,Last);  
  Last=Time[0];
  rofs = (Rperiod + 1)/3.0;
  for (bar = CBars; bar >= 0; bar--) {
     rsum = 0;
     for (r = Rperiod; r >= 1; r--)
        rsum += (r - rofs) * Close[Rperiod - r + bar];
     buf0[bar] = 6.0 * rsum / (Rperiod * (Rperiod + 1));
     buf1[bar] = buf0[bar + 1] + 2.0 * (buf0[bar] - buf0[bar + 1]) / (LSMA_Period + 1);
     buf2[bar] = buf0[bar];
     buf3[bar] = buf1[bar];
     if (buf0[bar] < buf1[bar]) {
        buf3[bar] = EMPTY_VALUE;
        buf2[bar] = EMPTY_VALUE;
     }
  }
  return (0);
}

regards

Ad augusta per angusta
Link to comment
Share on other sites

Re: Good Indicator Need small fix

 

I made it to draw it in histogram (if you set the indicator window max value to 1, then it wont go up and down, just colors). If you want it to use it to an EA you can compare the values of the indi. If higher than previous buy if lower then sell. I hope you can use it. Please if you come to some conclusion I would be really happy to read it. Anyway I think this indi is simmilar to NonLagMA. Last bar is redrawing.

slil.ru/27935818

 

http://img137.imageshack.us/img137/4443/picture22p.png

Link to comment
Share on other sites

Re: Good Indicator Need small fix

 

I made it to draw it in histogram (if you set the indicator window max value to 1, then it wont go up and down, just colors). If you want it to use it to an EA you can compare the values of the indi. If higher than previous buy if lower then sell. I hope you can use it. Please if you come to some conclusion I would be really happy to read it. Anyway I think this indi is simmilar to NonLagMA. Last bar is redrawing.

slil.ru/27935818

 

http://img137.imageshack.us/img137/4443/picture22p.png

 

 

thanks I will going to test next week. Thisa indicator is part of manual sistem I currentlu testing and seems working fine.

I will post it here soon. I am using it on 1H and it gives very good signals. Problem is that I have to stay on my desk to che signals every hour. Maybe if somone find it a good system, it can be coded into an EA.

Let's see.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...