Least squares moving average indicator

 

Hi,

I'm using this LSMA indicator on MT4 but I'd like it to calculate using the price high of each bar.


I'm not sure which price it's currently using but its not the high. I can't figure out the relevant variable to change in the code below.

linreg_function is the section of of the main body (linreg) that calculates it and the rest of linreg plots it.


 Please help! :)

Files:
 
Pandroo: I'm not sure which price it's currently using but its not the high. I can't figure out the relevant variable to change in the code below.
      c=Close[x+i];
  1. Why are you not sure? Why are you not able to change the code? If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.

  2. Why did you post your MT4 question in the Root / MT5 General section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.