All for whom want to be Richer.
沒有經過學習就直接去交易,就像是沒經過外科訓練就直接去開刀。
如果不知道怎麼交易獲利,應該先學習和思考成功交易者的作法。
站內的程式碼僅供Tradestation與Multicharts學習使用,不代表獲利保證,直接用於交易者請自己承擔盈虧責任。
(程式碼) Pivots System
[LegacyColorValue = TRUE];
{ *****************************************************************************************
Study : Pivots System
*******************************************************************************************}
Input: ProfitPt(0), TrailBar(4);
Vars: Pivot(0), Support1(0), Support2(0), Support3(0),
Resistance1(0), Resistance2(0), Resistance3(0),
BearMarket(false) , BullMarket(false);
{ Calculation of Pivot, support and resistance points }
Pivot = ( Low + High + Close ) / 3;
Resistance1 = ( Pivot * 2 ) - Low;
Resistance2 = Pivot + Range;
Resistance3 = Resistance1 + Range;
Support1 = ( Pivot * 2 ) - High;
Support2 = Pivot - Range;
Support3 = Support1 - Range;
{ Determination of market character }
BullMarket = Average( Close , 4 ) > Average( Close , 9 ) AND Average( Close , 9 ) > Average( Close , 18 );
BearMarket = Average( Close , 4 ) < Average( Close , 9 ) AND Average( Close , 9 ) < Average( Close , 18 );
{ Placement of long orders }
If BullMarket then Begin
Buy ("Bull R2") next bar at Resistance2 stop;
Buy ("Bull R3") next bar at Resistance3 stop;
end;
{ Placement of short orders }
If bearmarket then begin
SellShort ("Bear S2") next bar at Support2 stop;
SellShort ("Bear S3") next bar at Support3 stop;
end;
{ Exit at first Profitable Open }
If MarketPosition = 1 and Open next bar > EntryPrice + ProfitPt + Commission * CurrentContracts / BigPointValue then
Sell ("Long Profit")next bar at Open;
If MarketPosition = -1 and Open next bar < EntryPrice - ProfitPt - Commission * CurrentContracts / BigPointValue then
BuytoCover ("Short Profit") next bar at Open;
{ Exit with trailing stops }
Sell next bar Lowest( Low , TrailBar ) Stop;
BuytoCover next bar Highest( High , TrailBar ) Stop;