  Menu Home Rus Finance Carol Alexander - market Contents list of illustrations Computerized trading An introduction The disciplined trader - developing Wiley trading seriesbeyond By wiluam MC'laren Trade your way The Theory of Interest Publications in operations Introduction to Econometrics Methods of Wall-Street Master First editionwith 140 This book was Icroeconomicprinciplespaul templea buffer The gann pyramtosquare The harmonic traderby Also by david The profit magic The symmetry wave back start next

[start]                                                  [ 50 ]    

50

If FloatValue > 0.0 Then Begin

While TcrtalVolume < FloatValue and Bailndex < MaxBarsBack Begin TatalVolume = TotalVolume + Volume[BarIndex]; Bailndex = Barlndex + i; End; End; End;

AcmeCetFloatBars = Barlndex;

AcmeGetShares

ftcneCetShaies: Calculate the number of shares based en risk model

RiskModel = 1. Equal Value Units Model RiskModel = 2, Percent Risk Model RiskModel = 3. Percent Volatility Model **«»,*♦*************♦*****************�+♦*♦*.

Inputs:

Equity(Nuineric), RiskModel(Numeric). RiskPercent(Numeric), RiskUnits(Numeric);

Variables:

MinimumShares(200), RiskShares(O), ERP(O.o), Length(20);

ERP = Equity * RiskPercent / lOO;

If RiskModel - 1 and Close > 0 Then RiskShares = MaxList(MiniinumShares. 100 � IntPortion(Equity / (lOO * Close)));

If RiskModel = 2 and RiskUnits > 0 Then RiskShares = MaxList(MiniinumShares, 100 * IntPortion(ERP / (100 * RiskUnits)));

If RiskModel = 3 and Volatility(Length) > 0 Then RiskShares MaxList(HinimumShares, 100 * IntPortion(ERP / (100 * Volatility(Length))));

AcmeGetShares = RiskShares;

AcmeHarami: Search for the extended Harami Pattern

Variables:

RPLimit(0.45), RRLimit(0.60), Haramil(False), Harami2(False). Haramis(False);

AcmeHarami = 0;

If Range[l] > 0 and Range[2l > 0 and Range > 0 Then Begin Conditionl = Low >= Low[l] and High <= High[l]; Condition2 = Close > Open;

Conditions = AcmeRangePercent(Close, l)[l] <= RPLimit and

AcmeRangePercent(Open, l)[l] >= (l - RPLimit);

Condition4 = (Range / Range[l]} <= RRLimit;

Haramil = Conditionl and Condition2 and Conditions and

Condition4;

Conditionl = Low >= Low[2l and High <= High; Condition2 = Low[l] >= Low and High[l] <= High; Conditions = Close > Open;

Condition4 = AcmeRangePercent(Close, l) <= RPLimit and AcmeRangePercent(Open, l)[2l >= (l - RPLimit); Conditions = (Range / Range) <= RRLimit; Harami2 = Conditionl and Condition2 and Conditions and Condition* and Conditions;

Conditionl = Low >= Low and High <= High; Condition2 = Low[l] >= Low and High[l] <= H:h;

Low >= Low and High <= High;

Conditions Condition4 = Close Conditions

Open;

it(Close, 1) <= RPLimit and

AcmeRangePercent (Open, 1)[ ] >= (l - RPLimit); Condition6 = (Range / Range) <= RRLimit; Haramis = Conditionl and Condition2 and Conditions and Condition4 and Conditions and Condition6;

If Haramil or Harami2 or Haramis Then AcmeHarami l;

Condition] - Low > Low[l) and High < HIfi; Condilion2 CloM < 0pm;

Curalilionl Afin>«.in-PiMnl<()>.-ii. Itmitill......

Aii**.nii4-IVM.-nl(l 1..-. , l)l (I Krihiill). f.HHlil mil.] {K.iii,;,- / l) hi.......I.

Haramil = Conditioni and Condition2 and Conditions and ConditionA;

Conditioni Condition! Conditions Condition4

Low >= Low and High <= High; Low[l] >= Low and High[l] <= High; Close < Open;

AcmeRangePercent(Open, l) <= RPLimit and AcmeRangePercent(Close. 1) >= (1 - RPLimit); Conditions = (Range / Range) <= RRLimit; Harami2 = Conditioni and Condition! and Conditions and Condition4 and Conditions;

Conditioni = Low >= Low[S] and High <= High; Condition2 = Low[l] >= Low[S] and High[l] <= High[s]; Conditions = Low >= Low[S] and High High[s]; Condition4 = Close < Open;

Conditions = AcmeRangePercent(Open, l)[S] <= RPLimit and AcmeRangePercent(Close, 1)[S] >= (1 - RPLimit); Condition6 = (Range / Range[S]) <= RRLimit; HaramiS = Conditioni and Condition! and Conditions and ConditionA and Conditions and Condition6;

If Haramil or Harami! or HaramiS Then AcmeHarami = !;

End;

AcmeHighLowlndex

Function

AcmeHighLowlndex: Calculate the High Low Index

Inputs:

Price(Numeric), Length(Numeric);

AcmeHighLowlndex = 0;

If Price[l] >= Highest(Price, Length - l) and Price < Price[l] Then

AcmeHighLowlndex = 1 Else If Price[l] <= Lowest(Price, Length - l) and Price > Pricefl] Then

AcmeHighLowlndex = 2;

AcmeHook: Search for a Hook Pattern

Inputs:

Length(Numeric), Percent(Numeric);

AcmeHook = O;

If AcmeRetraceUp(Length)[l] and Low < Low[l] and

AcmeRangePercent(Close, l) >= (l - Percent) Then AcmeHook = l;

If AcmeRetraceDown(Length) and High > High[l] and

AcmeRangePercent(Close, 1) <= Percent Then AcmeHook = 2;

AcmelnsideDay2

Function

AcmeInsideDay2 = False;

If Low > Low[l] and High < High[l] and Low[l] > Low and High[l] < High Then AcmelnsideDay! = True;

AcmelnsidePayNR Function

AcmelnsideDayNR: Find an inside day / narrow range bar

4 « « 4-4 « * 4 «!) + * 4 * 4< * * ***** « * >! f *** >! A******* 4-** * * *

>44:*44*4-44<44-*4**4444"*444

. bar

*4«*4t+*«***«X444*J

Inputs:

Rang<.-L<--nKMi(�im<>iiL), lii<li>y(N.imcii. );

Aiiiir-lMMili-li.iv� l.il-.c-.

If Range < Lowest(Range, RangeLength - l)[Index + l] and Low > Low[l] and High < Hihll] Then AcmelnsideDayNR = True;

Function

Inputs:

LoggingOn(TrueFalse), LogFileName(5tring), SystemlD(String);

Variables:

Length(30).

If LoggingOn and Category = 2 Then Begin

{Log Closed Positions}

If BarsSinceExit(l) = i Then Begin TradeString = CetSymbolWame + + NufnTo5tr(EntryDate(l), 0) + + NuniToStr(EntryPrice(l), 3) + "," + NuntToStr(ExitDate(l), 0) + + NufnToStr(ExitPrice(l), 3) + "," + NufnToStr(PositionProfit(l), 3) + + NufnTo5tr(ADX(ADXLength)[BarsSinceEntry(l)], 0) + "," + NufnToStr(Volatility(Length)[BarsSinceEntry(l)], 2) + + NunrToStr(AcmeVolatility(Length)fBarsSinceEntiy(l)], 3) + "," + SystemID + NewLine; FileAppend(LogFileName, TradeString);

End;

{Log Open Positions)

If LastBarOnChart and CurrentEntries > 0 Then Begin TradeString = CetSymbolName + + NumToStr(EntryDate(O), 0) + "," + NumToStr(EntryPrice(0), ) + "." + NumToStr (Date, 0) + + NumToStr(Close, 3) + + NumToStr(OpenPositionProfit, 3) + + NumToStr(ADX(ADXLength)[BarsSinceEntry(o)l, O) + "," + NumToStr(Volatility(Length)[Bar5Sincrlrtry(o), 2) "," ♦ N.imTnSlr(A(i4.-Vol.ililily(lrni.th)h.nv4iiui-h(liy(0), 0 i "." 1 .v-hiiiin I Ni-wl ill.-; I ili-Atiii-iiil{hi>;l (lc-ri.inir, h.tili-M i 114,),

End;

AcmeNarrowRange

AcmeNarrowRange: Is the specified bar a narrow range bar?

Inputs:

RangeLength(Numeric), Index(Numeric);

AcmeNarrowRange = False;

If Range < Lowest(Range, RangeLength - l)[Index + l] Then AcmeNarrowRange = True;

AcmeOnAverage

AcmeOnAverage: Is the current bar sitting on the movir average?

Inputs:

Length(Numeric);

Variables: MA(O.O);

AcmeOnAverage = False; HA = Average(Close, Length); If HA >= Low and HA <= High Then AcmeOnAverage = True;

AcmePullback: Search for a Cann Pullback Patlrtri

InfiuK:

11 1 iiril(mii[....... ).

hii)-.lh(niim<-rii );

[start]                                                  [ 50 ] Menu Main page Forex Trading by the minute About trading futures Closing the gap   