Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, SBGuy, TipmyPip, ozgur), 923 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Can anybody help me code this indicator - DSS bessert #457800
01/31/16 18:46
01/31/16 18:46
Joined: Jan 2016
Posts: 16
R
roshanbaba Offline OP
Newbie
roshanbaba  Offline OP
Newbie
R

Joined: Jan 2016
Posts: 16

#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);
}
//+------------------------

Re: Can anybody help me code this indicator - DSS bessert [Re: roshanbaba] #457805
01/31/16 21:18
01/31/16 21:18
Joined: Dec 2013
Posts: 568
Fuerth, DE
Sphin Offline
User
Sphin  Offline
User

Joined: Dec 2013
Posts: 568
Fuerth, DE
This looks impressive. The DSS Bressert is more simple:

Code:
var Periods = 16;
var Smoothing = 4;
vars Price = series(priceClose());

var HiHi = HH(Periods);
var LoLo = LL(Periods);

vars EMA_exp = series((Price[0]-LoLo)/(HiHi-LoLo));

vars Temp = series(EMA(EMA_exp,Smoothing));

var TempHigh = MaxVal(Temp,Periods);
var TempLow = MinVal(Temp,Periods);

vars DSS_exp = series((Temp[0]-TempLow)/(TempHigh-TempLow));

vars DSS_Bressert = series(EMA(DSS_exp,Smoothing));
vars Signal = series(SMA(DSS_Bressert,3));


Re: Can anybody help me code this indicator - DSS bessert [Re: Sphin] #457812
02/01/16 11:20
02/01/16 11:20
Joined: Jan 2016
Posts: 16
R
roshanbaba Offline OP
Newbie
roshanbaba  Offline OP
Newbie
R

Joined: Jan 2016
Posts: 16
Thank You So much


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1