|
本帖最後由 joshsmi 於 14-5-2 07:20 編輯
DumbMoney 發表於 14-4-30 23:18
哈哈哈,是的,我就是说的这句。
I don't know what you mean but as for multiple strategies ...
BuyA = Cross( CCI( 20 ), 100 );
SellA = Cross( 100, CCI( 20 ) );
BuyB = Cross( MACD(), Signal() );
SellB = Cross( Signal(), MACD() );
A = B = 0;
Buy = Sell = 0;
for ( i = 0; i < BarCount; i ++ )
{
if ( BuyA[ i ])
{
Buy[ i ] = 1;
B = 0;
A = 1;
}
if ( BuyB[ i ] )
{
Buy[ i ]= 1;
B = 1;
A = 0;
}
if ( SellA[i] )
{
Sell[i] = 1;
}
if ( SellB[i] )
{
Sell[i] = 1;
}
}
Buy = ExRem( Buy, Sell );
Sell = ExRem( Sell, Buy );
BuyPrice = SellPrice = Close;
_N( Title = StrFormat( "{{NAME}} - {{INTERVAL}} - {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%), Vol %g {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ), V ) );
Plot( C, "Close", ParamColor( "Color", colorDefault ), styleNoTitle | ParamStyle( "Style" ) | GetPriceStyle(), null, null, 0, 0, 1 );
PlotShapes( Buy*shapeSmallUpTriangle, colorGreen, 0, L, -15 );
PlotShapes( Buy*shapeHollowSmallUpTriangle, colorLightGrey, 0, L, -15 );
PlotShapes( Buy*shapeHollowSmallCircle, colorGreen, 0, BuyPrice, 0 );
PlotShapes( Sell*shapeDownArrow, colorRed, 0, H, -15 );
PlotShapes( Sell*shapeHollowDownArrow, colorLightGrey, 0, H, -15 );
PlotShapes( Sell*shapeHollowSmallCircle, colorRed, 0, SellPrice, 0 );
|
|