Bull Engulfing patern - EL & vesticode

Vragen en suggesties over Vesticode

Moderator: Perry

Bull Engulfing patern - EL & vesticode

Berichtdoor JPR » ma 22 sep 2003, 18:28

input: Price(Close), Length(10), BodyLen(10);
vars: BullEngulfing(False), LongEntryPrice(0), UpTrend(False),
DownTrend(False), AvgBody(0), HighestC(0), LowestC(999999);

{ Setup calculations }
UpTrend = XAverage( Price, Length ) > XAverage( Price, Length )[1] ;
DownTrend = XAverage( Price, Length ) < XAverage( Price, Length )[1] ;
AvgBody = Average( AbsValue(Close - Open), BodyLen );

BullEngulfing = ( Close > Open ?AND
?Close[1] < Open[1] ) AND
( Close > Open[1] AND Open < Close[1] )AND
( Close - Open > AvgBody * 1.25 ) AND
( Open[1] - Close[1] < AvgBody * .75 );

if DownTrend and BullEngulfing thenLongEntryPrice = High;

{ Entry orders }
if MRO( DownTrend and BullEngulfing, 3 , 1) > -1 AND MarketPosition <> 1 then
Buy next bar at LongEntryPrice stop; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Bovenstaande EL code krijg ik niet aan de praat ondanks dat ik geen foutmelding krijg......... Waarschijnlijk die MRO functie... wie weet een oplossing??? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
JPR
 
Berichten: 85
Geregistreerd op: wo 03 jul 2002, 18:39

Bull Engulfing patern

Berichtdoor Paul M » ma 22 sep 2003, 20:29

Hallo JPR,

Nieuwe functie MRO2:

{*******************************************************************
Description: Most Recent Occurrence
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Expression(TrueFalseSeries), Length(NumericSimple), Occur(NumericSimple);
Variables: TrueCount(0), Counter(0);

Counter = 0;
TrueCount = 0;

While Counter < Length AND TrueCount < Occur Begin
If Expression[Counter] Then
TrueCount = TrueCount + 1;
Counter = Counter + 1;
End;
If TrueCount >= Occur AND TrueCount > 0 Then
MRO2 = Counter - 1 + CurrentBar - BarNumber
Else
MRO2 = -1;

Systeem:

input: Price(Close), Length(10), BodyLen(10);
vars: BullEngulfing(False), LongEntryPrice(0), UpTrend(False),
DownTrend(False), AvgBody(0), HighestC(0), LowestC(999999);

{ Setup calculations }
UpTrend = XAverage( Price, Length ) > XAverage( Price[1], Length ) ;
DownTrend = XAverage( Price, Length ) < XAverage( Price[1], Length ) ;
AvgBody = Average( AbsValue(Close - Open), BodyLen );

BullEngulfing = ( Close > Open ?AND
?Close[1] < Open[1] ) AND
( Close > Open[1] AND Open < Close[1] )AND
( Close - Open > AvgBody * 1.25 ) AND
( Open[1] - Close[1] < AvgBody * .75 );

if DownTrend and BullEngulfing then LongEntryPrice = High;

{ Entry orders }

if MRO2( DownTrend and BullEngulfing, 3 , 1) > -1 AND MarketPosition <> 1 then
Buy ; ?
if MRO2( UpTrend and BullEngulfing, 3 , 1) > -1 AND MarketPosition <> -1 then
sell ;
end; ? ? ? ? ? ? ? ? ? ?

Succes,

Paul

Beste via edit---kopieeren.
Paul M
 
Berichten: 263
Geregistreerd op: vr 13 dec 2002, 23:21

Bull Engulfing patern

Berichtdoor JPR » ma 22 sep 2003, 21:25

Paul Bedankt......... zal je het resultaat binnenkort melden. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Voor de liefhebbers... ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? input: Price(Close), Length(10), BodyLen(10);
vars: BearEngulfing(False), ShortEntryPrice(0), UpTrend(False),
DownTrend(False), AvgBody(0), HighestC(0), LowestC(999999);

{ Setup calculations }
UpTrend = XAverage( Price, Length ) > XAverage( Price, Length )[1] ;
DownTrend = XAverage( Price, Length ) < XAverage( Price, Length )[1] ;
AvgBody = Average( AbsValue(Close - Open), BodyLen );

BearEngulfing = ( Open > Close AND
?Open[1] < Close[1] ) AND
( Open > Close[1] AND Close < Open[1] ) AND
( Open - Close > AvgBody * 1.25 ) AND
( Close[1] - Open[1] < AvgBody * .75 );

if UpTrend and BearEngulfing thenShortEntryprice = Low;

{ Entry orders }
if MRO( UpTrend and BearEngulfing, 3 , 1) > -1 AND MarketPosition <> -1 then
Sell Short next bar at ShortEntryPrice stop;

How it works: ? ?A bullish engulfing pattern is defined as a large, hollow real body that engulfs a small, filled real body in a downtrend. Which a bearish engulfing pattern is defined as a large, filled real body that engulfss a small, hollow real body in an uptrend.
These patterns are indicative of a reversal in direction of the price movement. For example, it can be argued that if the market is in an uptrent, and you find a Bearish Engulfing pattern, a trend reversal is likely, and vice versa.

This strategy uses an exponential moving average to determine the trend direction. It states that the market is in an uptrend when the 10 bar exponential average is greater than the same average of one bar ago. And the opposite will mark a bullish trend.

A large body is defined as a body that is at least 125% larget than the average body of the last 10 bars. When the strategy finds an uptrend and a bullish engulfing pattern it will establish a short position, and if the market is in a down trend and the market develops a bearish engulfing pattern the strategy will establish a long position.

Inputs: ? ?Input Name Default Value Description ?
Price ?Close Price used to calculate the exponential average
Length ?10 Period, defined in number of bars, to use when calculating the exponential average
BodyLen ?10 Number of bars to use in calculating the average size of the real body

?
JPR
 
Berichten: 85
Geregistreerd op: wo 03 jul 2002, 18:39


Keer terug naar Vesticode

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers en 16 gasten

cron