kilroy 大您好
想要請教 箭頭畫圖
我在您 108樓 改寫的內容裡加上了 PlotShapes()
但我回到 K線圖 並沒有看到
在進出場點上有箭頭的符號
是不是
我還需要設定什麼?
感謝~
程式碼如下:
SetOption( "MaxOpenPositions" , 1 );
SetOption( "InitialEquity" , 10000 );
SetOption( "FuturesMode" , 1 );
SetOption( "CommissionMode" , 3 );
SetOption( "CommissionAmount" , 6.5 );
RoundLotSize = 1;
if ( Name () == "6A #F" )
{
TickSize = 0.0001 ;
MarginDeposit = 3000 ;
PS = 10000;
PointValue = 10 * PS;
}
_SECTION_END();
MA5_P1 = Ref( MA( C, 5 ), -1 );
MA5_P2 = Ref( MA( C, 5 ), -2 );
Cond_MA5_Buy = MA5_P1 > MA5_P2;
Cond_MA5_Sell = MA5_P1 < MA5_P2;
Cross5_Buy = Cross ( Ref( C, -1 ), MA5_P1 );
Cross5_Sell = Cross ( MA5_P1, Ref( C, -1 ) );
Buy = Cond_MA5_Buy AND Cross5_Buy ;
Sell = Cross5_Sell;
Short = Cond_MA5_Sell AND Cross5_Sell ;
Cover = Cond_MA5_Buy ;
Buy = ExRem(Buy, Short);
Short = ExRem(Short, Buy);
Cover = ExRem(Cover , Sell );
Sell = ExRem(Sell , Cover );
BuyPrice = CoverPric = O;
ShortPrice = SellPrice = O;
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Sell, shapeSquare, shapeNone),colorGreen, 0, H, Offset=40);
PlotShapes(IIf(Cover, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
|