[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Mark Fisher´s ACD method



PureBytes Links

Trading Reference Links

I don't remember who wrote this, but it should give you a good place to  
start.  You will need the following  
plugin:http://www.amibroker.org/3rdparty/deDateTime.zip.

MaxGraph=5;
GraphXSpace = 1;

// Start of variables used to calculate custom formulas

// Defines market hours
MarketOpen      = 93000;
MarketClose     = 161500;
MarketHours     = deFlagTimeRange(MarketOpen, MarketClose);
FirstBarOfDay   = deFlagFirstBarOfDay(MarketOpen);
LastBarOfDay    = deFlagLastBarOfDay(MarketClose);
enumMarketHours = BarsSince(FirstBarOfDay);

// First 5 minutes of Opening Range
OR5High   = deTimeRangeHHV(H,MarketOpen,93500);
OR5Low    = deTimeRangeLLV(L,MarketOpen,93500);
OR5Median = (OR5High+OR5Low)/2;

// First 15 minutes of Opening Range
OR15High  = deTimeRangeHHV(H,MarketOpen,94500);
OR15Low   = deTimeRangeLLV(L,MarketOpen,94500);
OR15Median = (OR15High+OR15Low)/2;

// First 30 minutes of Opening Range
OR30High  = deTimeRangeHHV(H,MarketOpen,100000);
OR30Low   = deTimeRangeLLV(L,MarketOpen,100000);

// First 60 minutes of Opening Range
OR60High  = deTimeRangeHHV(H,MarketOpen,103000);
OR60Low   = deTimeRangeLLV(L,MarketOpen,103000);

// Yesterdays Daily values. Note: By adjusting Daysback to a greater
//value, all the calculations below will go back a number of
//corresponding days (ie: Daysback = 5 means 5 days ago)
DaysBack = 1;

YesterdaysHigh    =
ValueWhen(Ref(deFlagLastBarOfDay(MarketClose),-1),deTimeRangeHHV(H,MarketOpen,MarketClose),DaysBack);
YesterdaysLow     =
ValueWhen(Ref(deFlagLastBarOfDay(MarketClose),-1),deTimeRangeLLV(L,MarketOpen,MarketClose),DaysBack);
YesterdaysOpen    = ValueWhen(deFlagLastBarOfDay(MarketOpen),O,DaysBack);
YesterdaysClose   =
ValueWhen(Ref(deFlagLastBarOfDay(MarketClose),-1),C,DaysBack);
Yesterdays2HrHigh =
ValueWhen(Ref(LastBarOfDay,-1),deTimeRangeHHV(H,141500,161500),DaysBack);

Yesterdays2HrLow  =
ValueWhen(Ref(LastBarOfDay,-1),deTimeRangeLLV(L,141500,161500),DaysBack);


// Start of custom calculations & formulas
DailyPivot     = (YesterdaysHigh+YesterdaysLow+YesterdaysClose)/3;
DailyMedian    = (YesterdaysHigh+YesterdaysLow)/2;
DailyPivotHigh = DailyPivot + abs(DailyPivot - DailyMedian);
DailyPivotLow  = DailyPivot - abs(DailyPivot - DailyMedian);
R1             = ((2 * DailyPivot) - YesterdaysLow);
S1             = ((2 * DailyPivot) - YesterdaysHigh);
R2             = ((DailyPivot - S1) + R1);
S2             = (DailyPivot - (R1 - S1));
R3             = (R2 + (YesterdaysHigh - YesterdaysLow));
S3             = (S2 - (YesterdaysHigh - YesterdaysLow));

DayFilter =
deValueWhenTime((Sum(C>OR5Median,enumMarketHours)+Sum(O>OR5Median,enumMarketHours)+Sum(H>OR5Median,enumMarketHours)+Sum(L>OR5Median,enumMarketHours))/
4,103000);

ACDHighOffset = ACDLowOffset = (OR15high - OR15low) * .50;
ACDHigh       = OR15High + ACDHighOffset;
ACDLow        = OR15Low - ACDLowOffset;

// Same variables as above, but plotting during after hours is suppressed
YestHighClean       = IIf(MarketHours,YesterdaysHigh,Null);
YestLowClean        = IIf(MarketHours,YesterdaysLow,Null);
YestCloseClean      = IIf(MarketHours,YesterdaysOpen,Null);
YestCloseClean      = IIf(MarketHours,YesterdaysClose,Null);
Y2HrHighClean       = IIf(MarketHours,Yesterdays2HrHigh,Null);
Y2HrLowClean        = IIf(MarketHours,Yesterdays2HrLow,Null);
DailyPivotClean     = IIf(MarketHours,DailyPivot,Null);
DailyPivotHighClean = IIf(MarketHours,DailyPivotHigh,Null);
DailyPivotLowClean  = IIf(MarketHours,DailyPivotlow,Null);
ACDHighClean        = IIf(MarketHours,ACDHigh,Null);
ACDLowClean         = IIf(MarketHours,ACDLow,Null);
OR5MedianClean      = IIf(MarketHours,OR5Median,Null);
OR15MedianClean     = IIf(MarketHours,OR15Median,Null);
OR15HighClean	      = IIf(MarketHours,OR15High,Null);
OR15LowClean	      = IIf(MarketHours,OR15Low,Null);
R1Clean             = IIf(MarketHours,R1,Null);
S1Clean             = IIf(MarketHours,S1,Null);
//R2Clean             = IIf(MarketHours,R2,Null);
//S2Clean             = IIf(MarketHours,S2,Null);



//  Start of variables used to control color of bars/indicators
BullishBar = H > Ref(H,-1) AND L > Ref(L,-1);
BearishBar = H < Ref(H,-1) AND L < Ref(L,-1);
PriceColor =
IIf(deFlagTimeRange(MarketOpen,93500),colorWhite,IIf(deFlagTimeRange(93500,94500),colorLightBlue,IIf(MarketHours==False,colorDarkBlue,IIf(BullishBar,colorGreen,IIf(BearishBar,colorRed,colorLightGrey)))));
ORBarColor = IIf(deFlagTimeRange(93000,94500),0,colorOrange);
ORBarColor1 = IIf(deFlagTimeRange(93000,94500),0,colorBlue);
ORBarColor2 = IIf(deFlagTimeRange(93000,94500),0,colorYellow);
// Start of Plot() functions to display calculated series
//Plot(C,"C",PriceColor,styleBar+styleThick);
PlotOHLC( Open, High, Low, Close, Name(), colorBlack, styleCandle);

      // Close
//Plot(EMA((O+H+L+C)/4,7),"EMA7",colorGreen,styleLine);
//Plot(EMA((O+H+L+C)/4,15),"EMA7",colorBlue,styleLine);
//Plot(OR5MedianClean,"5M",colorBlue,styleLine);
      // Clayburg 5 Minute Mid Line
if(Interval() < 84600) {
	show_ACD = ParamToggle("ACD Bands On/Off","Off|On");
	if (show_ACD ) {
		Plot(OR15MedianClean,"15M",ORbarcolor1,styleLine);
		Plot(OR15HighClean,"15H",ORbarcolor2,styleLine);
		Plot(OR15LowClean,"15L",ORbarcolor2,styleLine);
		Plot(ACDHighClean,"ACDH",ORbarcolor,styleLine+styleThick);
      		// ACD High Threshold
		Plot(ACDLowClean,"ACDL",ORbarcolor,styleLine+styleThick);
      		// ACD Low Threshold
		//Plot(YestHighClean,"YH",colorLightGrey,styleLine+styleThick);
      		// Yesterdays High
		//Plot(YestLowClean,"YL",colorLightGrey,styleLine+styleThick);
      		// Yesterdays Low
		//Plot(DailyPivotClean,"PP",colorLightBlue,styleLine+styleThick);
    		// Pivot
		//Plot(DailyPivotHighClean,"PH",colorPink,styleLine+styleThick);
      		// Pivot High
		//Plot(DailyPivotLowClean,"PL",colorPink,styleLine+styleThick);
      		// Pivot Low
		//Plot(R1Clean,"R1",colorRed,styleLine+styleThick);
      		// R1 Pivot
		//Plot(S1Clean,"S1",colorRed,styleLine+styleThick);
      		// S1 Pivot
		//Plot(Y2HrHighClean,"Y2H",colorBrightGreen,styleLine+styleThick);
      		// Yesterdays 2Hr High
		//Plot(Y2HrLowClean,"Y2L",colorBrightGreen,styleLine+styleThick);
      		// Yesterdays 2Hr Low
		//Plot(R2Clean,"R2",colorRed,styleLine+styleThick);
        	// R2 Pivot
		//Plot(S2Clean,"S2",colorRed,styleLine+styleThick);
        	// S2 Pivot

		// Plot color bands
		//Plot(ACDLowClean,"ACDL",colorBlack,styleArea);
		// ACD Low Threshold
		//Plot(ACDHighClean,"ACDH",IIf(TimeNum()>=94500 AND  
TimeNum()<=MarketClose,colorDarkGreen,colorBlack),styleArea);
		// ACD High Threshold
	}
}

Title = Name() + "-" + Interval(2) + " " + Date() + "\nOpen: "+O + ",  
High:"+ H + ", Low: "+ L + ", Close: "+C ;//+ "\nACDH: "  
+ NumToStr(ACDHighClean,1.3) + ", ACDL: " + NumToStr(ACDLowClean,1.3);










On Tue, 31 May 2005 12:14:51 -0400, traderix2003 <d.adam@xxxxxxx> wrote:

> I wonder if any trader here has read Mark Fisher´s book ("The Logical
> Trader")and is trading his ACD method??
> Is it possible to  plot his opening break out, offsets and pivot range
> from a single AFL custom formula?
>
> Regards  Daniel
>
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> Yahoo! Groups Links
>
>
>
>
>
>




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/