Sunteți pe pagina 1din 7

_SECTION_BEGIN("Month/Year/Vol low/high");

SetChartOptions( 1, Flags = 0, 0);


_N(Title = "");

High9M = IIf(H>Ref(HHV(H, 9*20) , -1) AND (Ref(C,-9*20) != 0),13,10);


High6M = IIf(H>Ref(HHV(H, 125) , -1) AND (Ref(C,-125) != 0),12,10);
High3M = IIf(H>Ref(HHV(H, 3*20) , -1) AND (Ref(C,-3*20) != 0),11,10);

Low9M = IIf(L<Ref(LLV(L, 9*20) , -1) AND (Ref(C,-9*20) != 0),11,14);


Low6M = IIf(L<Ref(LLV(L, 125) , -1) AND (Ref(C,-125) != 0),12,14);
Low3M = IIf(L<Ref(LLV(L, 3*20) , -1) AND (Ref(C,-3*20) != 0),13,14);

Plot(High9M, "3/6/9 Month High",ParamColor("high9 Color",colorRed),


ParamStyle("high9 Style", styleLine)|styleNoTitle|styleNoLabel);
Plot(High6M, "6",ParamColor("high6 Color",colorRed), ParamStyle("high6
Style", styleLine)|styleNoTitle|styleNoLabel);
Plot(high3M, "3",ParamColor("high3 Color",colorRed), ParamStyle("high3
Style", styleLine)|styleNoTitle|styleNoLabel);

Plot(Low9M, "3/6/9 Month Low",ParamColor("low9 Color",colorBlue),


ParamStyle("low9 Style", styleLine|styleNoTitle|styleNoLabel));
Plot(Low6M, "6",ParamColor("low6 Color",colorBlue), ParamStyle("low6 Style",
styleLine)|styleNoTitle|styleNoLabel);
Plot(Low3M, "3",ParamColor("low3 Color",colorBlue), ParamStyle("low3 Style",
styleLine)|styleNoTitle|styleNoLabel);

p = 250;

High1Y = IIf(H > Ref(HHV(H, 1*p), -1) AND Ref(C,-1*p) != 0, 6, 5);


high2Y = IIf(H > Ref(HHV(H, 2*p), -1) AND Ref(C,-1*p) != 0, 7, 5);
High3Y = IIf(H > Ref(HHV(H, 3*p), -1) AND Ref(C,-1*p) != 0, 8, 5);

Low1Y = IIf(L < Ref(LLV(L, 1*p), -1) AND Ref(C,-1*p) != 0, 8, 9);


low2Y = IIf(L < Ref(LLV(L, 2*p), -1) AND Ref(C,-1*p) != 0, 7, 9);
Low3Y = IIf(L < Ref(LLV(L, 3*p), -1) AND Ref(C,-1*p) != 0, 6, 9);

Plot(high1Y, "1/2/3 Year High 1",ParamColor("high1 Color",colorRed),


ParamStyle("high1 Style", styleLine)|styleNoTitle|styleNoLabel);
Plot(high2Y, "2",ParamColor("high2 Color",colorRed), ParamStyle("high2
Style", styleLine)|styleNoTitle|styleNoLabel);
Plot(high3Y, "3",ParamColor("high3 Color",colorRed), ParamStyle("high3
Style", styleLine)|styleNoTitle|styleNoLabel);

Plot(Low1Y, "1/2/3 Year Low 1",ParamColor("low1 Color",colorBlue),


ParamStyle("low1 Style", styleLine)|styleNoTitle|styleNoLabel);
Plot(Low2Y, "2",ParamColor("low2 Color",colorBlue), ParamStyle("low2 Style",
styleLine)|styleNoTitle|styleNoLabel);
Plot(Low3Y, "3",ParamColor("low3 Color",colorBlue), ParamStyle("low3 Style",
styleLine)|styleNoTitle|styleNoLabel);

p = 125;

value5 = IIf(V>=5*MA(V, p),4,0);


value4 = IIf(V>=4*MA(V, p),3.2,0);
value3 = IIf(V>=3*MA(V, p),2.4,0);
value2 = IIf(V>=2*MA(V, p),1.6,0);
value1 = IIf(V>=1*MA(V, p),0.8,0);

Plot(value5, "Acc Volume 5x",ParamColor("value5 Color",colorRed),


ParamStyle("value5 Style", styleLine|styleNoTitle|styleNoLabel));
Plot(value4, "4x",ParamColor("value4 Color",colorRed), ParamStyle("value4
Style", styleLine|styleNoTitle|styleNoLabel));
Plot(value3, "3x",ParamColor("value3 Color",colorRed), ParamStyle("value3
Style", styleLine|styleNoTitle|styleNoLabel));
Plot(value2, "2x",ParamColor("value2 Color",colorRed), ParamStyle("value2
Style", styleLine|styleNoTitle|styleNoLabel));
Plot(value1, "1x",ParamColor("value1 Color",colorRed), ParamStyle("value1
Style", styleLine|styleNoTitle|styleNoLabel));

_SECTION_END();

Xu hướng cổ phiếu cực chuẩn


// Downloaded From www.WiseStockTrader.com
_SECTION_BEGIN("RWIHI");
minperiods = Param( "Min Periods", 9, 1, 200, 1 );
maxperiods = Param( "Max Periods", 40, 1, 200, 1 );
Plot( RWIHi( minperiods, maxperiods) , _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("RWILO");
minperiods = Param( "Min Periods", 9, 1, 200, 1 );
maxperiods = Param( "Max Periods", 40, 1, 200, 1 );
Plot( RWILo( minperiods, maxperiods) , _DEFAULT_NAME(), ParamColor( "Color",
colorCycle ), ParamStyle("Style") );
_SECTION_END();

_SECTION_BEGIN("Line");
Line = Param( "Line", 1 );
Plot( Line, "Line", colorRed, styleThick | styleDashed | styleNoLabel );
_SECTION_END();

_SECTION_BEGIN("RWI System");
Sell = Cross( Line, RWIHi( minperiods, maxperiods));
Buy = Cross( RWILo( minperiods, maxperiods), Line);

for( i = 0; i < BarCount; i++ )


{
if( Buy[i] ) PlotText( "Bull vs Bear" , i, 1,colorLavender);
if( Sell[i] ) PlotText( "Bull vs Bear" , i, 1, colorLavender);
}
_SECTION_END();

Code 4
// Downloaded From www.WiseStockTrader.com
_SECTION_BEGIN( "Mother Candle Formation Strategy" );

/*
Here is another Trade Plan using simple candlestick analysis.
The idea on this strategy is to catch a break from a sudden move of a big
candle move.
It can be done on any time series of chart, but recommended on the 10 or 60
minute charts.
Only one trade Per symbol per day,recommended to trade in minimum 7 symbols
(mini lots).
Optimization can be done only on profit and target for Entry we are using a
plugin named "MotherCandle".
Plugin should be placed into amibroker (c/programfiles/amibroker/plugins)
folder.
This AFL will work only if microsoft visual c++ 2017 redistributable package
(x86).
You Can dowload from microsoft website
https://go.microsoft.com/fwlink/?LinkId=746571.

Created By Viatrades Algo Team.


viatradess@gmail.com
*/

SetPositionSize( 1, spsShares );
SetBarsRequired( sbrAll, sbrAll );

SetChartOptions( 0, chartShowArrows | chartShowDates );


SetChartBkGradientFill( colorBlack, colorBlack, colorBlack );
Plot( C, "", IIf( C > O, colorBlueGrey, IIf( C <= O, colorOrange,
colorLightGrey ) ), 64 | styleNoTitle, 0, 0, 0, 0 );

GraphXSpace = 10;

DN = DateNum();
TN = TimeNum();

function Asign( x )
{
y = Null;

for( i = 0; i < BarCount; i++ )


{
y[i] = x;
}

return y;
}

Target = Param( "Target %", 1, 0.1, 50, 0.01 ) / 100;


StopLoss = Param( "Stop Loss %", 0.75, 0.1, 50, 0.01 ) / 100;
DaysTrades = Param( "Trades / Day", 2, 0, 50, 1 );

DayStart = DN != Ref( DN, -1 );


DayEnd = Ref( DayStart, 1 );
////If below line ( MotherCandle();) is in Black color please install
microsoft visual c++ 2017 redistributable package (x86).
//you Can dowload from microsoft website"
https://go.microsoft.com/fwlink/?LinkId=746571 ".
MotherCandle();

Buy = Asign( False );


Sell = Asign( False );
Short = Asign( False );
Cover = Asign( False );

BuyPrice = Null;
ShortPrice = Null;

BYPRSV = Null;
SHPRSV = Null;

LF1 = False;
LF2 = False;
SF1 = False;
SF2 = False;

LSL = Null;
SSL = Null;

LTGT = Null;
STGT = Null;

count = 0;

for( i = 1; i < BarCount; i++ )


{
if( DayStart[i] == True )
{
count = 0;
}

// Long Trade
if( BuyTrig[i] != 0 && High[i] >= BuyTrig[i] && LF1 == False && LF2 ==
False && DayStart[i] == False && count < DaysTrades )
{
Buy[i] = True;
LF1 = True;
BYPRSV = BuyTrig[i];

if( Open[i] > BYPRSV )


{
BYPRSV = Open[i];
}

LF2 = True;
count++;
}

if( LF1 == False && Close[i - 1] < BuyTrig[i] )


{
LF2 = False;
}

if( LF1 == True )


{
BuyPrice[i] = BYPRSV;
LSL[i] = BYPRSV - ( BYPRSV * StopLoss );
LTGT[i] = BYPRSV + ( BYPRSV * Target );
}

if( LF1 == True && High[i] > LTGT[i] )


{
Sell[i] = True;
SellPrice[i] = Close[i];
LF1 = False;
BuyPrice[i] = Null;
LSL[i] = Null;
LTGT[i] = Null;
}

if( LF1 == True && Low[i] < LSL[i] )


{
Sell[i] = True;
SellPrice[i] = Close[i];
LF1 = False;
BuyPrice[i] = Null;
LSL[i] = Null;
LTGT[i] = Null;
}

if( LF1 == True && DayEnd[i] == True )


{
Sell[i] = True;
SellPrice[i] = Close[i];
LF1 = False;
BuyPrice[i] = Null;
LSL[i] = Null;
LTGT[i] = Null;
}

// Short Trade
if( ShortTrig[i] != 0 && Low[i] < ShortTrig[i] && SF1 == False && SF2 ==
False && DayStart[i] == False && count < DaysTrades )
{
Short[i] = True;
SF1 = True;
SHPRSV = ShortTrig[i];

if( Open[i] < SHPRSV )


{
SHPRSV = Open[i];
}

SF2 = True;
count++;
}

if( SF1 == False && Close[i - 1] > ShortTrig[i] )


{
SF2 = False;
}
if( SF1 == True )
{
ShortPrice[i] = SHPRSV;
SSL[i] = SHPRSV + ( SHPRSV * StopLoss );
STGT[i] = SHPRSV - ( SHPRSV * Target );
}

if( SF1 == True && Low[i] < STGT[i] )


{
Cover[i] = True;
CoverPrice[i] = Close[i];
SF1 = False;
ShortPrice[i] = Null;
SSL[i] = Null;
STGT[i] = Null;
}

if( SF1 == True && High[i] > SSL[i] )


{
Cover[i] = True;
CoverPrice[i] = Close[i];
SF1 = False;
ShortPrice[i] = Null;
SSL[i] = Null;
STGT[i] = Null;
}

if( SF1 == True && DayEnd[i] == True )


{
Cover[i] = True;
CoverPrice[i] = Open[i];
SF1 = False;
ShortPrice[i] = Null;
SSL[i] = Null;
STGT[i] = Null;
}
}

Plot( BuyPrice, "Buy Price", colorYellow, styleStaircase | styleDashed );


Plot( LTGT, "Long Target", colorBrightGreen, styleStaircase | styleDashed );
Plot( LSL, "Long Stop Loss", colorCustom12, styleStaircase | styleDashed );

Plot( ShortPrice, "Short Price", colorYellow, styleStaircase | styleDashed );


Plot( STGT, "Short Target", colorBrightGreen, styleStaircase | styleDashed );
Plot( SSL, "Short StopLoss", colorCustom12, styleStaircase | styleDashed );

PlotShapes( IIf( Buy, shapeUpArrow, shapeNone ), colorBlueGrey, 0, Low, -15,


0 );
PlotShapes( IIf( Short, shapeDownArrow, shapeNone ), colorOrange, 0, High, -
15, 0 );
PlotShapes( IIf( Cover, shapeCircle, shapeNone ), colorBlueGrey, 0, Low, -35,
0 );
PlotShapes( IIf( Sell, shapeCircle, shapeNone ), colorOrange, 0, High, 35, 0
);
_SECTION_END();

S-ar putea să vă placă și