Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
can someone translate this tradestation script to mt4 and make it a envelope that adjust itself to highs and lows?
{*******************************************************************
Description : This Indicator plots Linear Regression
Provided By : Omega Research, Inc. (c) Copyright 1999
********************************************************************}
Inputs: Price(Close), Length(14), Displace(0);
If Displace >= 0 OR CurrentBar > AbsValue(Displace) Then Begin
Plot1[Displace](LinearRegValueFC(Price, Length, 0), "LinearReg");
{Alert Criteria}
If Price < Plot1 AND Plot1 Plot1[2] Then
Alert("The Linear Regression has just changed direction and is now bullish")
Else
If Price > Plot1 AND Plot1 > Plot1[1] AND Plot1[1] < Plot1[2] Then
Alert("The Linear Regression has just changed direction and is now bearish");
{Linear Regression Expert Commentary}
#BeginCmtry
Commentary(ExpertLinearReg(Length, Plot1));
#End;
End;