Formula for identifying Stochastic Divergence

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
sradke
Posts: 8
Joined: 27 Jun 2009

Formula for identifying Stochastic Divergence

Postby sradke » 27 Jun 2009

I am new to MultiCharts and don't yet understand the programming language at all. But, I'm wondering if anyone is aware of an exiting study that will spot Stochastic divergences.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Postby TJ » 27 Jun 2009

if you can describe it, you can program it.

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Postby SP » 28 Jun 2009


brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 30 Jun 2009

** Is the code available ? (or only for sale)

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Postby SP » 01 Jul 2009

As he shows the complete code and all vars i replicated it watching the video. I am not sure if it is ok if i post my version here.

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 01 Jul 2009

It should be ok to post to code, since the code is public info, being displayed on the video.

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Postby SP » 01 Jul 2009

Code: Select all

// http://markplex.com/tutorial26.php

Inputs : PriceL(Low),StochLength(7),SmoothingLength1(3),SmoothingLength2(3),SmoothingType(1),
Length(20),LeftStrength(3),RightStrength(1),BarTol(3);


vars: ofastk(0),oFastD(0),oSlowk(0),oSlowD(0),oPivotPrice1(0),oPivotBar1(0),oPivotPrice2(0),oPivotBar2(0),
oPivotPrice3(0),oPivotBar3(0),oPivotPrice4(0),oPivotBar4(0);


Value1=Stochastic(H,L,C,StochLength,SmoothingLength1,SmoothingLength2,SmoothingType,ofastk,ofastd,oslowk,oslowd);

//Determine if pivots in the price have occurred
Condition3 = Pivot(PriceL,Length,LeftStrength,RightStrength,1,-1,oPivotPrice3,oPivotBar3)<>-1;
Condition4 = Pivot(PriceL,Length,LeftStrength,RightStrength,2,-1,oPivotPrice4,oPivotBar4)<>-1;

//Determine if pivots in the stochstic have occurred
Condition1 = Pivot(oslowd,Length,LeftStrength,RightStrength,1,-1,oPivotPrice1,oPivotBar1)<>-1;
Condition2 = Pivot(oslowd,Length,LeftStrength,RightStrength,2,-1,oPivotPrice2,oPivotBar2)<>-1;


if condition3 and condition4 and condition1 and condition2
and (absvalue(oPivotbar1-oPivotBar3)<BarTol)
and (absvalue(oPivotbar2-oPivotBar4)<BarTol)
and (oPivotBar3 = RightStrength or oPivotbar1 = RightStrength)
and (oPivotPrice3<=oPivotPrice4 and oPivotPrice1>oPivotPrice2) and barstatus(1)=2 then
begin
value2= tl_new_S(D[oPivotBar4],Time_S[oPivotBar4],L[oPivotBar4],D[oPivotBar3],Time_s[oPivotBar3],L[oPivotBar3]);
tl_setcolor(value2,Green);
tl_setsize (value2,3);

value3= tl_new_Self_s(D[oPivotBar1],Time_S[oPivotBar1],oPivotPrice1,D[oPivotBar2],Time_s[oPivotBar2],oPivotPrice2);
tl_setcolor(value3,Green);
tl_setsize (value3,3);


end;
Plot1(oSlowD);

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Postby TJ » 01 Jul 2009

thankyou !

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 01 Jul 2009

Thanks !!
That will save considerable time.
Now I wonder if it's more accurate at actually calling a turn using divergence, it does make more sense this way.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Postby TJ » 01 Jul 2009

someone has posted all the codes in his blog.

I regret not saving the URL when I saw it,
because I did not think I would need them at that time.

SUPER
Posts: 646
Joined: 03 Mar 2007
Has thanked: 106 times
Been thanked: 84 times

Postby SUPER » 02 Jul 2009

SP,

Thanks for sharing, the tutorials are very useful.

One can buy easylanguage code for entire tutorial for $49.95 at following link.

http://www.markplex.com/downloadagreement16.php

Regards
Super

sradke
Posts: 8
Joined: 27 Jun 2009

Postby sradke » 06 Jul 2009

Thanks Everyone for all of the input- very helpful.


Return to “User Contributed Studies and Indicator Library”