Overblog Suivre ce blog
Editer l'article Administration Créer mon blog
22 octobre 2010 5 22 /10 /octobre /2010 18:06

 

 

http://codebase.mql4.com/ru/7055

 

Indicateur pratique avec 20 moyennes mobiles différentes .(T3, HULL,MEDIAN  Etc...)

 

 

 

 

0: SMA - Simple Moving Average
1: EMA - Exponential Moving Average
2: Wilder - Wilder Exponential Moving Average
3: LWMA - Linear Weighted Moving Average
4: SineWMA - Sine Weighted Moving Average
5: TriMA - Triangular Moving Average
6: LSMA - Least Square Moving Average (or End-Point MA,or Linear Regression Line)
7: SMMA - Smoothed Moving Average
8: HMA - Hull Moving Average by Alan Hull
9: ZeroLagEMA - Zero-Lag Exponential Moving Average
10: DEMA - Double Exponential Moving Average by Patrick Mulloy
11: T3 - T3 by T.Tillson
12: ITrend - Instantaneous Trendline by J.Ehlers
13: Median - Moving Median
14: GeoMean - Geometric Mean
15: REMA - Regularized EMA by Chris Satchwell
16: ILRS - Integral of Linear Regression Slope
17: IE/2 - Combination of LSMA and ILRS
18: TriMAgen - Triangular Moving Average generalized by J.Ehlers
19: VWMA - Volume Weighted Moving Average
20: JSmooth - Smoothing by Mark Jurik

 

Partager cet article

Repost 0
Published by SOHOCOOL - dans METATRADER
commenter cet article

commentaires

isaaff1 29/02/2012 21:15

Et bien je suis désolée mais il me l'ouvre pas dans marketshot avec FXCM, c'est peut être l'extension qui ne va pas. Pouvez vous me dire comment faire ??

SOHOCOOL 05/03/2012 10:33



Le mieux est de contacter FXCM ,pour demander si on sait mettre des


indicateurs exterieur.Et si oui comment ?



isa.aff1 23/02/2012 10:56

Peux t'on obtenir la même chose qui fonctionne avec le fxcm. Merci

SOHOCOOL 29/02/2012 14:51



Je crois que Fxcm a la plateforme Mt4, donc l'indicateur dois fonctionner.



EMA 26/10/2010 23:56


J'ai rencontre ce code qui je pense c'est easylanguage. Est ce que quelq'un peut traduire pour Prorealtime ?
function Init()
indicator:name("Averages indicator");
indicator:description("Averages indicator");
indicator:requiredSource(core.Tick);
indicator:type(core.Indicator);

indicator.parameters:addGroup("Calculation");
indicator.parameters:addString("Method", "Method", "", "MVA");
indicator.parameters:addStringAlternative("Method", "MVA", "", "MVA");
indicator.parameters:addStringAlternative("Method", "EMA", "", "EMA");
indicator.parameters:addStringAlternative("Method", "Wilder", "", "Wilder");
indicator.parameters:addStringAlternative("Method", "LWMA", "", "LWMA");
indicator.parameters:addStringAlternative("Method", "SineWMA", "", "SineWMA");
indicator.parameters:addStringAlternative("Method", "TriMA", "", "TriMA");
indicator.parameters:addStringAlternative("Method", "LSMA", "", "LSMA");
indicator.parameters:addStringAlternative("Method", "SMMA", "", "SMMA");
indicator.parameters:addStringAlternative("Method", "HMA", "", "HMA");
indicator.parameters:addStringAlternative("Method", "ZeroLagEMA", "", "ZeroLagEMA");
indicator.parameters:addStringAlternative("Method", "DEMA", "", "DEMA");
indicator.parameters:addStringAlternative("Method", "T3", "", "T3");
indicator.parameters:addStringAlternative("Method", "ITrend", "", "ITrend");
indicator.parameters:addStringAlternative("Method", "Median", "", "Median");
indicator.parameters:addStringAlternative("Method", "GeoMean", "", "GeoMean");
indicator.parameters:addStringAlternative("Method", "REMA", "", "REMA");
indicator.parameters:addStringAlternative("Method", "ILRS", "", "ILRS");
indicator.parameters:addStringAlternative("Method", "IE/2", "", "IE/2");
indicator.parameters:addStringAlternative("Method", "TriMAgen", "", "TriMAgen");
indicator.parameters:addStringAlternative("Method", "JSmooth", "", "JSmooth");

indicator.parameters:addInteger("Period", "Period", "", 20);
indicator.parameters:addBoolean("ColorMode", "ColorMode", "", true);

indicator.parameters:addGroup("Style");
indicator.parameters:addColor("MainClr", "Main color", "Main color", core.rgb(0, 255, 0));
indicator.parameters:addColor("UPclr", "UP color", "UP color", core.rgb(255, 0, 0));
indicator.parameters:addColor("DNclr", "DN color", "DN color", core.rgb(0, 0, 255));
indicator.parameters:addInteger("widthLinReg", "Line width", "Line width", 1, 1, 5);
indicator.parameters:addInteger("styleLinReg", "Line style", "Line style", core.LINE_SOLID);
indicator.parameters:setFlag("styleLinReg", core.FLAG_LINE_STYLE);
end

local first;
local source = nil;
local Method;
local Period;
local MA;
local Array1;
local Array2;
local Array3;
local Array4;
local Array5;
local Array6;
local Arrays={};
local MainBuff=nil;
local UPBuff=nil;
local DNBuff=nil;
local ColorMode;

function Prepare()
source = instance.source;
Method=instance.parameters.Method;
Period=instance.parameters.Period;
ColorMode=instance.parameters.ColorMode;
first = source:first()+2;
MA = instance:addInternalStream(first+Period, 0);
Array1 = instance:addInternalStream(first, 0);
Array2 = instance:addInternalStream(first, 0);
Array3 = instance:addInternalStream(first, 0);
Array4 = instance:addInternalStream(first, 0);
Array5 = instance:addInternalStream(first, 0);
Array6 = instance:addInternalStream(first, 0);
Arrays[1]=Array1;
Arrays[2]=Array2;
Arrays[3]=Array3;
Arrays[4]=Array4;
Arrays[5]=Array5;
Arrays[6]=Array6;
local name = profile:id() .. "(" .. source:name() .. ", " .. instance.parameters.Method .. ", " .. instance.parameters.Period .. ")";
instance:name(name);
MainBuff = instance:addStream("MainBuff", core.Line, name .. ".MA", "MA", instance.parameters.MainClr, first);
UPBuff = instance:addStream("UPBuff", core.Line, name .. ".UP", "UP", instance.parameters.UPclr, first);
DNBuff = instance:addStream("DNBuff", core.Line, name .. ".DN", "DN", instance.parameters.DNclr, first);
MainBuff:setWidth(instance.parameters.widthLinReg);
MainBuff:setStyle(instance.parameters.styleLinReg);
UPBuff:setWidth(instance.parameters.widthLinReg);
UPBuff:setStyle(instance.parameters.styleLinReg);
DNBuff:setWidth(instance.parameters.widthLinReg);
DNBuff:setStyle(instance.parameters.styleLinReg);
end

function MVA(Price,shift,MAarray,Period_)
if shift>first+Period_ then
return core.avg(Price,core.rangeTo(shift,Period_));
elseif shift>=first then
return core.avg(Price,core.range(first,shift));
else return 0;
end
end

function EMA(Price,shift,MAarray,Period_)
if shift==first then
return Price[shift];
else
return MAarray[shift-1]+2/(1+Period_)*(Price[shift]-MAarray[shift-1]);
end
end

function Wilder(Price,shift,MAarray,Period_)
if shift>=first and shiftfirst+Period_ then
return MAarray[shift-1]+(Price[shift]-MAarray[shift-1])/Period_;
end
end

function LWMA(Price,shift,MAarray,Period_)
if shift>first+Period_ then
local Weight=0;
local Sum=0;
local i;
for i=0,Period_-1,1 do
Weight=Weight+(Period_-i);
Sum=Sum+Price[shift-i]*(Period_-i);
end
if Weight>0 then
return Sum/Weight;
else
return 0;
end
else
return 0;
end
end

function SineWMA(Price,shift,MAarray,Period_)
if shift>=first then
local Sum=0;
local Weight=0;
local i;
r=core.range(math.max(shift-Period_+1,first),shift);
for i=r.from,shift,1 do
Weight=Weight+math.sin(math.pi*(shift-i+1)/(Period_+1));
Sum=Sum+Price[i]*math.sin(math.pi*(shift-i+1)/(Period_+1));
end
if Weight>0 then
return Sum/Weight;
else
return 0;
end
end
end

function TriMA(Price,shift,MAarray,Period_)
if shift>=first+Period_ then
local len=math.ceil((Period_+1)/2);
local Sum=0;
local i;
for i=0,len-1,1 do
Sum=Sum+MVA(Price,shift-i,MAarray,len);
end
return Sum/len;
end
end

function LSMA(Price,shift,MAarray,Period_)
if shift>=first+Period_ then
local Sum=0;
local i;
for i=1,Period_,1 do
Sum=Sum+(i-(Period_+1)/3)*Price[shift-Period_+i];
end
return Sum*6/(Period_*(Period_+1));
end
end

function SMMA(Price,shift,MAarray,Period_)
if shift==first+Period_ then
return MVA(Price,shift,MAarray,Period_);
elseif shift>first+Period_ then
local Sum=0;
local i;
for i=0,Period_-1,1 do
Sum=Sum+Price[shift-i-1];
end
return (Sum-MAarray[shift-1]+Price[shift])/Period_;
end
end

function HMA(Price,shift,MAarray,Period_)
local len=math.floor(math.sqrt(Period_));
if shift==first+Period_+len then
return Price[shift];
elseif shift>first+Period_+len then
local i;
for i=0,len-1,1 do
Array1[first+Period_+len-1-i]=2*LWMA(Price,shift-i,MAarray,math.floor(Period_/2))-LWMA(Price,shift-i,MAarray,Period_);
end
return LWMA(Array1,first+Period_+len-1,MAarray,len-1);
end
end

function ZeroLagEMA(Price,shift,MAarray,Period_)
local Alpha=2/(Period_+1);
local lag=math.ceil((Period_-1)/2);
if shift=first+Period_ then
local gmean=math.pow(Price[shift],1/Period_);
local i;
for i=1,Period_-1,1 do
gmean=gmean*math.pow(Price[shift-i],1/Period_);
end
return gmean;
end
end

function REMA(Price,shift,MAarray,Period_)
local Alpha=2/(Period_+1);
local Lambda=0.5;
if shift=first+Period_ then
return 0.5*(ILRS(Price,shift,MAarray,Period_)+LSMA(Price,shift,MAarray,Period_));
end
end

function TriMAgen(Price,shift,MAarray,Period_)
if shift>=first+Period_ then
local len1=math.floor((Period_+1)/2);
local len2=math.ceil((Period_+1)/2);
local sum=0;
local i;
for i=0,len2-1,1 do
sum=sum+MVA(Price,shift-i,MAarray,len1);
end
return sum/len2;
end
end

function JSmooth(Price,shift,MAarray,Period_)
local Alpha=0.45*(Period_-1)/(0.45*(Period_-1)+2);
if shift=first) then
if Method=="MVA" then
MA[period]=MVA(source,period,MA,Period);
elseif Method=="EMA" then
MA[period]=EMA(source,period,MA,Period);
elseif Method=="Wilder" then
MA[period]=Wilder(source,period,MA,Period);
elseif Method=="LWMA" then
MA[period]=LWMA(source,period,MA,Period);
elseif Method=="SineWMA" then
MA[period]=SineWMA(source,period,MA,Period);
elseif Method=="TriMA" then


EMA 25/10/2010 14:58


le code pour prorealtime si vous plait. Merci.


SOHOCOOL 27/10/2010 10:51



JE ne pense pas que ce soit possible de traduire cet indicateur en Prt.


De plus ces moyennes sont déjà programmées,seules ,pour la plupart en Prt.


@+