Medium Term Weighted Stochastics (STPMT)

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Medium Term Weighted Stochastics (STPMT)

Postby Apprentice » Fri Feb 04, 2011 2:57 pm

STPMT.png


The indicator is calculated by the formula
STPMT = [4.1*sto(5,3,3) + 2.5*sto(14,3,3) + sto(45,14,3) + 4*sto(75,20,3)] / 11.6

In addition to the indicator, the indicator shows the moving average of it and individual components.
STPMT.lua
(5.91 KiB) Downloaded 1161 times


The indicator was revised and updated
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Medium Term Weighted Stochastics (STPMT)

Postby bourik » Fri Feb 04, 2011 3:34 pm

Thanks you very much Apprentice :D

Jérôme
bourik
 
Posts: 13
Joined: Fri Feb 04, 2011 4:09 am

Re: Medium Term Weighted Stochastics (STPMT)

Postby bourik » Sun Feb 06, 2011 8:04 am

Hello

I'm ashamed of all my requests but is it possible to make the indicator called "cycle", which is the difference between the STPMT and is MM9

Respectfully

Jérôme
bourik
 
Posts: 13
Joined: Fri Feb 04, 2011 4:09 am

Re: Medium Term Weighted Stochastics (STPMT)

Postby Apprentice » Sun Feb 06, 2011 8:50 am

Sure, but you will have to be more eloquent in giving, the request.
MM9 is 9 period moving avegage of STPMT?
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Medium Term Weighted Stochastics (STPMT)

Postby bourik » Sun Feb 06, 2011 11:40 am

this is the code of the indicator "cycle" for MT4 : it's the difference between the STPMT and the MM9 of the STPMT

sorry but like you can see my english is very poor and I can't explain better how is calculate this indicator :(

Code: Select all
//| Cycles

#property copyright ""
#property link ""

#property indicator_separate_window
#property indicator_buffers 7
#property indicator_color7 Red

// buffers
double Cycle[];
double Buffer1[];
double Buffer2[];
double Buffer3[];
double Buffer4[];
double STPMT[];
double STPMT_MA[];

//| Custom indicator initialization function |

int init() {
string short_name;
short_name="Cycles";
IndicatorShortName(short_name);
// indicators
IndicatorBuffers(7);
SetIndexBuffer(0, Buffer1);
SetIndexBuffer(1, Buffer2);
SetIndexBuffer(2, Buffer3);
SetIndexBuffer(3, Buffer4);
SetIndexBuffer(4, STPMT);
SetIndexBuffer(5, STPMT_MA);
SetIndexBuffer(6, Cycle);

SetIndexStyle(0, DRAW_NONE);
SetIndexStyle(1, DRAW_NONE);
SetIndexStyle(2, DRAW_NONE);
SetIndexStyle(3, DRAW_NONE);
SetIndexStyle(4, DRAW_NONE);
SetIndexStyle(5, DRAW_NONE);
SetIndexStyle(6, DRAW_LINE, EMPTY, 1);

//
return(0);
}

//| iteration function |

int start() {

int index = 0;
int counted_bars=IndicatorCounted();

int limit = Bars - counted_bars;

for(index=0;index<limit;index++) {
Buffer1[index] = iStochastic( NULL, 0, 5, 3, 3, MODE_SMA, 0, MODE_SIGNAL, index);
Buffer2[index] = iStochastic( NULL, 0, 14, 3, 3, MODE_SMA, 0, MODE_SIGNAL, index);
Buffer3[index] = iStochastic( NULL, 0, 45, 14, 3, MODE_SMA, 0, MODE_SIGNAL, index);
Buffer4[index] = iStochastic( NULL, 0, 75, 20, 3, MODE_SMA, 0, MODE_SIGNAL, index);
STPMT[index] = (4.1 * Buffer1[index] + 2.5 * Buffer2[index] + Buffer3[index] + 4 * Buffer4[index]) / 11.6;
}
for(index=0;index<limit;index++) {
STPMT_MA[index] = iMAOnArray(STPMT, 0, 9, 0, MODE_SMA, index);
Cycle[index] = (STPMT[index] - STPMT_MA[index])*6;
}
return(0);
}

I hope it would be enough for my request
bourik
 
Posts: 13
Joined: Fri Feb 04, 2011 4:09 am

Re: Medium Term Weighted Stochastics (STPMT)

Postby Apprentice » Sun Feb 06, 2011 3:19 pm

Cycle.png

I hope this version suits your needs.

Cycle indicator is calculated on the basis of Medium Term Weighted Stochastics components.
The formula of this indicator.

Cycle[period]= (STPMT[period]- STPMT_MA[period])*6;
Cycle.lua
(4.55 KiB) Downloaded 906 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36476
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Medium Term Weighted Stochastics (STPMT)

Postby bourik » Mon Feb 07, 2011 2:44 am

It's perfect

Thanks a lot Apprentice and have a good week :mrgreen:
bourik
 
Posts: 13
Joined: Fri Feb 04, 2011 4:09 am


Re: Medium Term Weighted Stochastics (STPMT)

Postby scandisk » Fri Mar 24, 2017 1:55 am

Hi Apprentice

I wanted custom levels and line color and thickness added to the STPMT.

Thanks ;)
scandisk
 
Posts: 89
Joined: Thu Jul 25, 2013 4:51 pm


Next

Return to Custom Indicators

Who is online

Users browsing this forum: No registered users and 218 guests