Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

KASE DevStop Long for Amibroker (AFL)

Rating:
2 / 5 (Votes 3)
Tags:
amibroker

As can be seen from the formula, she uses standard deviations for the user to decide at what point to exit a position.
Stops are set where there is increasing statistical probability of reversal against the trend.
This is supposedly based on the log normal shape of the curve of the range curve.

Philosophy:

The DevStop is the closest we can come to an ideal stop level in the real world.
The indicator mathematics accounts for volatility (which is directly proportional to risk),
AND also for the variance of volatility (how much risk changes from bar to bar)
AND volatility skew (the propensity for volatility to spike higher from time to time).

Specifically, the DevStop places exit points at 1, 2 AND 3 standard deviations over the mean two bar True range,
corrected for skew. So we can take profit OR cut losses at levels at which the probability of a trade remaining profitable is Low,
without taking more of a loss OR cutting profits any sooner than necessary.

Interpretation:

The stop consists of four exit points, a Warning line AND Dev 1, 2 AND 3. Two closes against the warning count as Dev 1.

1. True range is very similar to the high-low range of a bar, except that it considers gaps, so
2. TrueRange =@max (H, C1) – @min(L, C1), so the range of a pair of bars is
3. TRD (TrueRangeDouble) = @max (H, H1, C2) – @min(L, L1, C2)
4. Reversals included in stop magnitudes relating to TRD as follows
a. Rev1 = one standard deviation over average TRD
b. Rev3 = 3.6 standard deviations over average TRD
5. DevStop price level calculated by
a. Deducting applicable Rev from high if up market
b. Adding applicable Rev to low if down market

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez almost 10 years ago
Advanced Elliott Waves
Submitted by MarcosEn over 12 years ago
3_6Day GuaiLiLv
Submitted by motorfly over 12 years ago
Williams Alligator System
Submitted by durgesh1712 over 12 years ago
*Level Breakout system*
Submitted by Tinych over 12 years ago
Horizontal Live Priceline Tool
Submitted by northstar over 12 years ago

Indicator / Formula

Copy & Paste Friendly
//KASE DevStop I L

//COMMON EXPRESSIONS
TrueH= IIf(H > Ref(C,-1),H,Ref(C,-1));
TrueL= IIf(L < Ref(C,-1),L,Ref(C,-1));
True_Range=TrueH-TrueL;

R1=IIf(H>Ref(H,-1),H,Ref(H,-1));
True_Double_H=Max(R1,Ref(C,-2));
R2=IIf(L<Ref(L,-1),L,Ref(L,-1));
True_Double_L=Min(R2,Ref(C,-2));
True_Range_Double= True_Double_H - True_Double_L;

True_Range_Double_SD=StDev(True_Range_Double,60);
True_Range_Double_SD_30=StDev(True_Range_Double,30);
True_Range_Double_SD_Percent=True_Range_Double_SD*100/HHV(H,2);
True_Range_Double_SD_Normalised=MA(True_Range_Double_SD,400);
True_Range_Double_SD_P_Normalised=MA(True_Range_Double_SD_Percent,400);

TRD_MA=MA(True_Range_Double,25);

Warning_Line_L = H-TRD_MA;
Dev1_L = H - TRD_MA - True_Range_Double_SD_30;
Dev2_L = H - TRD_MA - 2.2*True_Range_Double_SD_30;
Dev3_L = H - TRD_MA - 3.6*True_Range_Double_SD_30;

Warning_Line_S = L+TRD_MA;
Dev1_S = L + TRD_MA + True_Range_Double_SD_30;
Dev2_S = L + TRD_MA + 2.2*True_Range_Double_SD_30;
Dev3_S = L + TRD_MA + 3.6*True_Range_Double_SD_30;

Stop_Loss_Long = IIf(C>Dev1_L, C-Dev1_L, C/100);
Stop_Trail_Long = IIf(C>Dev2_L, C-Dev2_L, C/100);
Stop_Loss_Long_MA = MA(Stop_Loss_Long,3);

P = ParamField("Price");

Capital = Param("Capital",10000000,10000,100000000,1);
Risk=0.0025*Capital;
PositionSize = (Risk/Max(Stop_Loss_Long_MA,Stop_Loss_Long))*P;
PositionSize_Percent= PositionSize*100/Capital;

Plot(Max(Stop_Loss_Long,Stop_Loss_Long_MA),"Stop Loss Long", ParamColor( "Stop Loss Long - Color", colorDarkOliveGreen));
Plot(Stop_Trail_Long,"Stop Trail Long", ParamColor( "Stop Trail Long - Color", colorRed));
Plot(PositionSize,"Position Size", ParamColor( "Position Size - Color", colorDarkRed), styleOwnScale | styleNoLabel | styleNoLine);
Plot(PositionSize_Percent,"Position Size %", ParamColor( "Position Size % - Color", colorDarkTeal), styleOwnScale | styleNoLabel | styleNoLine);

1 comments

1. jvyadav@gmail.com

Very good work..

Leave Comment

Please login here to leave a comment.

Back