Page 1 of 1

Formula for identifying Stochastic Divergence

Posted: 27 Jun 2009
by sradke
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.

Posted: 27 Jun 2009
by TJ
if you can describe it, you can program it.

Posted: 28 Jun 2009
by SP

Posted: 30 Jun 2009
by brodnicki steven
** Is the code available ? (or only for sale)

Posted: 01 Jul 2009
by SP
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.

Posted: 01 Jul 2009
by brodnicki steven
It should be ok to post to code, since the code is public info, being displayed on the video.

Posted: 01 Jul 2009
by SP

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);

Posted: 01 Jul 2009
by TJ
thankyou !

Posted: 01 Jul 2009
by brodnicki steven
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.

Posted: 01 Jul 2009
by TJ
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.

Posted: 02 Jul 2009
by SUPER
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

Posted: 06 Jul 2009
by sradke
Thanks Everyone for all of the input- very helpful.