EasyTrader NQ_Test 03
Williams %R是由在世界交易競賽中贏得優秀、創下輝煌戰績的知名投資者Larry R. Williams所開發的技術指標。震盪指標的概要主要是為了掌握「以一定期間的最高價與最低價的範圍為基準,掌握最近的收盤價相對處於何種水平」。
// Public Variable
vars:MP(0),PF(0),PL(0),BuyPrice(0),ShortPrice(0),BasePF(600),BasePL(300) ;
vars:BarPass(5),HLRange(0),WinPoint(0),HBarPos(0),LBarPos(0),ExitH(0),ExitL(0),TimeOK(false),EntryExitCond(false),SelectNo(0) ;
vars:jumpPoint(0) ;
jumpPoint = MinMove/PriceScale ;
Condition98 = 多方交易濾網 ;
//****************** Basic Setup ****************************************
MP = MarketPosition ;
if MP <> 0 then Begin
PF = EntryPrice*TradeProfit ;
PL = EntryPrice*TradeStopLoss ;
end else begin
PF = AvgPrice*TradeProfit ;
PL = AvgPrice*TradeStopLoss ;
end ;
PF = MinList(PF,2500/BigPointValue) ;
PL = MinList(PL,1000/BigPointValue) ;
// ************* Time Set Up *************
TimeOK = (time >= 1900 or time <= 1100) ;
//***************** BuyPrice & ShortPrice Setup *****************
BuyPrice = HighW(1) ;
// ********** Main Strategy *********
// ********** Entry Method
//計算威廉指標 & ADX
// ******** William PercentR Entry ***********
vars:PR1(0),vADX1(0),PR2(0),vADX2(0) ;
PR1 = PercentR(LenA1);
vADX1 = ADX(LenB1);
PR2 = PercentR(LenA2);
vADX2 = ADX(LenB2);
if TimeOK then begin
//ADX值 & 威廉指標大於設定值 則收盤價突破設定價位作多
if Condition98 and MP <> 1 and vADX1 > NBarL and PR1 > HighBand and Close < BuyPrice then Buy ("LE_PcentRT") next bar at BuyPrice stop;
end ;
//停損及停利
// ************* Base Exit *************
if MP <> 0 then WinPoint = MaxPositionProfit/BigPointValue else WinPoint = 0 ;
if MP > 0 then Sell ("2PL1_"+NumtoStr(PL,0)) next bar at EntryPrice-PL stop ;if MP > 0 then Sell ("2PF1_"+NumtoStr(PF,0)) next bar at EntryPrice+PF limit ;
// 持有多單 虧損超過預期 平倉出場
if MP > 0 and (BarsSinceEntry <= 300/Barinterval and maxpositionloss/currentcontracts < -700)
then sell ("WrongEntryL2") next bar at Close stop ;
小那斯達克 留倉 交易週期 2018/1/1 ~ 2024/5/31 交易成本 USD 60
沒有留言:
張貼留言