All for whom want to be Richer.
沒有經過學習就直接去交易,就像是沒經過外科訓練就直接去開刀。
如果不知道怎麼交易獲利,應該先學習和思考成功交易者的作法。
站內的程式碼僅供Tradestation與Multicharts學習使用,不代表獲利保證,直接用於交易者請自己承擔盈虧責任。
(程式碼) Spread System
[LegacyColorValue = TRUE];
{ *****************************************************************************************
Study : Spread System
*******************************************************************************************}
Inputs: Length(10), OBLevel(108), OSLevel(92), TrailBar(6), LowProf(100);
Vars: PctChange1(0), PctChange2(0), Spread(0), ExtraMeasure(0);
{ Percent Change of Data1 and Data2 }
If Close[Length] of Data1 <> 0 then
PctChange1 = ( Close of Data1 / Close[Length] of Data1 ) * 100;
If Close[Length] of Data2 <> 0 then
PctChange2 = ( Close of Data2 / Close[Length] of Data2 ) * 100;
{ Strength of Data1 versus Data2 }
If ( PctChange2 ) <> 0 then
Spread = ( PCtChange1 / PctChange2 ) * 100;
{ Entry orders }
If Spread < OSLevel Then
Buy this bar at Close;
If Spread > OBLevel Then
SellShort this bar at Close;
{ Trailing stop }
If PositionProfit > 0 then Begin
If MarketPosition = 1 then
Sell ("LongTrailStop") next bar at Lowest( Low , TrailBar ) - ExtraMeasure stop;
If MarketPosition = -1 then
BuytoCover ("ShortTrailStop")next bar at Highest( High , TrailBar ) + ExtraMeasure stop;
End;
{ Stale position exit }
If BarsSinceEntry > 6 AND PositionProfit < LowProf then Begin
Sell this bar on Close;
BuytoCover this bar on Close;
End;