Кому под силу переделать на МТ4

 
/*[[
Name := DSS Bressert
Author := Copyright © 2003, MetaQuotes Software Corp.
Link := http://www.metaquotes.net/ru/
Separate Window := yes
First Color := Red
First Draw Type := Line
Use Second Data := yes
second Color := lime
second Draw Type := Line
Minimum Chart Limits := 0.000000
Maximum Chart Limits := 100.000000
]]*/
Inputs : Slw(8),Pds(13),Slwsignal(9);
Variables : AA(0),bb(0),aa1(0),cnt1(0);

Variables : shift(0), cnt(0), loopbegin(0),loopbegin2(0),loopbegin3(0), first(True), prevbars(0);
Variables : sum(0), smconst(0),smconst1(0), prev(0),prev1(0),prev2(0),prev3(0), weight(0), linear(0);
Variables : MAValue(0),MAValue2(0),mavalue3(0), MAstring("");
Variables : MyHigh(0),MyLow(0),counter(0),Price(0),Price1(0);

SetLoopCount(0);
smconst = 2 / (1+SLW);
smconst1 = 2 / (1+slwsignal);



loopbegin = loopbegin+1;
For shift = 2000 Downto 0 Begin
prev = GetIndexValue2(shift+1);
AA =100* ((Close[shift] - Low[Lowest(MODE_LOW,shift+pds,Pds)]) / (High[Highest(MODE_HIGH,shift+pds,Pds)] - low[Lowest(MODE_LOW,shift+pds,Pds)]));
MAValue2 = smconst * (aa-prev) + prev;
SetIndexValue2(shift,MAValue2);
loopbegin = loopbegin-1;
End;

loopbegin2 = loopbegin2+1;
For shift = 2000-pds downto 0 Begin
MyHigh = -999999;
MyLow = 99999999;
For counter = shift to pds + shift Begin
PRICE= GetIndexValue2(counter);
If Price > MyHigh Then
MyHigh = Price;
If pds <= 0 Then
MyHigh = Price;
If Price < MyLow Then
MyLow = Price;
If pds <= 0 Then
MyLow = Price;
end;

prev1 = GetIndexValue(shift+1);
aa1=GetIndexValue2(shift);
bb=100*(aa1-mylow)/(myhigh-mylow);
MAValue = smconst * (bb-prev1) + prev1;
SetIndexValue(shift,mavalue);
loopbegin2 = loopbegin2-1;
End;


loopbegin3 = loopbegin3+1;
For shift = 2000 downto 0 Begin
prev2=GetIndexValue2(shift+1);
prev3=GetIndexValue(shift);
MAValue3= smconst1 * (prev3-prev2) +Prev2;

SetIndexValue2(shift,mavalue3);
loopbegin3 = loopbegin3-1;
end;
/*[[
Файлы:
 
//+------------------------------------------------------------------+
//| DSS Bressert.mq4 |
//| Copyright © 2008, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 DarkBlue
#property indicator_level1 20
#property indicator_level2 80

//---- input parameters
extern int EMA_period=8;
extern int Stochastic_period=13;
//---- buffers
double DssBuffer[];
double MitBuffer[];

double smooth_coefficient;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
  SetIndexStyle(0,DRAW_LINE);
  SetIndexBuffer(0,DssBuffer);
  SetIndexStyle(1,DRAW_LINE);
  SetIndexBuffer(1,MitBuffer);
   
  SetIndexEmptyValue(0, 0.0);
  SetIndexLabel(0, "DSS");
  SetIndexEmptyValue(1, 0.0);
  SetIndexLabel(1, "MIT");

  IndicatorShortName ("DSS("+EMA_period+","+Stochastic_period+")");

  smooth_coefficient = 2.0 / (1.0 + EMA_period);
//----
  return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
  return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
  {
  int i, limit, counted_bars=IndicatorCounted();
//----
  if (counted_bars == 0) limit = Bars - Stochastic_period;
  if (counted_bars > 0) limit = Bars - counted_bars;
   
  double HighRange, LowRange;
  double delta, MIT;
  for (i = limit; i >= 0; i--)
  {
  HighRange = High[iHighest(NULL,0,MODE_HIGH,Stochastic_period,i)];
  LowRange = Low[iLowest(NULL,0,MODE_LOW,Stochastic_period,i)];
  delta = Close[i] - LowRange;
  MIT = delta/(HighRange - LowRange)*100.0;
  MitBuffer[i] = smooth_coefficient * (MIT - MitBuffer[i+1]) + MitBuffer[i+1];
  }

  double DSS;
  for (i = limit; i >= 0; i--)
  {
  HighRange = MitBuffer[ArrayMaximum(MitBuffer, Stochastic_period, i)];
  LowRange = MitBuffer[ArrayMinimum(MitBuffer, Stochastic_period, i)];
  delta = MitBuffer[i] - LowRange;
  DSS = delta/(HighRange - LowRange)*100.0;
  DssBuffer[i] = smooth_coefficient * (DSS - DssBuffer[i+1]) + DssBuffer[i+1];
  }
   
//----
  return(0);
  }
//+------------------------------------------------------------------+
 
Jingo >>:
//+------------------------------------------------------------------+
//| DSS Bressert.mq4 |
//| Copyright © 2008, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 DarkBlue
#property indicator_level1 20
#property indicator_level2 80

//---- input parameters
extern int EMA_period=8;
extern int Stochastic_period=13;
//---- buffers
double DssBuffer[];
double MitBuffer[];

double smooth_coefficient;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,DssBuffer);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,MitBuffer);

SetIndexEmptyValue(0, 0.0);
SetIndexLabel(0, "DSS");
SetIndexEmptyValue(1, 0.0);
SetIndexLabel(1, "MIT");

IndicatorShortName ("DSS("+EMA_period+","+Stochastic_period+")");

smooth_coefficient = 2.0 / (1.0 + EMA_period);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i, limit, counted_bars=IndicatorCounted();
//----
if (counted_bars == 0) limit = Bars - Stochastic_period;
if (counted_bars > 0) limit = Bars - counted_bars;

double HighRange, LowRange;
double delta, MIT;
for (i = limit; i >= 0; i--)
{
HighRange = High[iHighest(NULL,0,MODE_HIGH,Stochastic_period,i)];
LowRange = Low[iLowest(NULL,0,MODE_LOW,Stochastic_period,i)];
delta = Close[i] - LowRange;
MIT = delta/(HighRange - LowRange)*100.0;
MitBuffer[i] = smooth_coefficient * (MIT - MitBuffer[i+1]) + MitBuffer[i+1];
}

double DSS;
for (i = limit; i >= 0; i--)
{
HighRange = MitBuffer[ArrayMaximum(MitBuffer, Stochastic_period, i)];
LowRange = MitBuffer[ArrayMinimum(MitBuffer, Stochastic_period, i)];
delta = MitBuffer[i] - LowRange;
DSS = delta/(HighRange - LowRange)*100.0;
DssBuffer[i] = smooth_coefficient * (DSS - DssBuffer[i+1]) + DssBuffer[i+1];
}

//----
return(0);
}
//+------------------------------------------------------------------+

Благодорю !!!; думал что здесь он вместе с цветными барами, может валяется у кого ???

Причина обращения: