// Settings
// ID: 20171118-113259-705904-QUW1K
// Price Data: Data1: ES.30.Minute.830.1500.CentralUSATime.txt, Data2: idx.30.Minute.830.1500.CentralUSATime.txt, Data3: spx.30.Minute.830.1500.CentralUSATime.txt
// MaxBarsBack: 500
// Profits Mode: Currency
// Quantity: 1
// Quantity Mode: FixedShareContracts
// Exit Stop Loss: 0
// Exit Profit Target: 0
// Exit Minutes: 0
// Fitness Criteria: NetProfit * AvgTrade
// Fitness Commission: 29.76
// Reports Commission: 0
// Commission Mode: TradePerSide
// Fitness Slippage: 0
// Reports Slippage: 0
// Slippage Mode: TradeRoundtrip
// Long Trading Allowed: True
// Short Trading Allowed: True
// Max. Entries per Day:
// GSB Version: 1.0.38.22 / 2017-10-16
// Performance (full period)
// Fitness: 4,719,742.25
// Net Profit: 53,350
// Commission (in $): 0
// Drawdown: -5,587.5
// Avg Trade: 181.46
// Percent Profitable: 67.69
// Pearson: 0.989
// Profit Factor: 2.16
// Trades Count: 294
// Net Profit / -Drawdown: 9.55
// Inputs
Inputs:
i1length(29),
i2length(21),
i1Weight(1),
i2Weight(1),
i3Weight(1),
entryLevel(459),
iSFWeight(1),
sfEntryLevel(22),
beginDate(20010618),
endDate(20170228);
// Vars
Vars:
id("20171118-113259-705904-QUW1K"),
debugScriptPath("c:\dropbox\GSB\GSB (Managers)\Data\Debugs\20171118-113259-705904-QUW1K.ts.txt"),
dateYmd(0),
timeHms(0),
weekDay(0),
currentBarDTOHLCV(""),
lastBarDTOHLCV(""),
result(0),
sfResult(0),
decision(0),
sfDecision(0),
tradeExitTime(1000000000),
zs(0.0000000001);
// MaxBarsBack check
Once (MaxBarsBack <> 500)
Begin
RaiseRunTimeError("MaxBarsBack (Maximum number of bars strategy will reference) must be set to 500 (from Properties for All button, General tab)");
End;
// Date YMD, Time HMS, and Day of week
dateYmd = Date + 19000000;
timeHms = StrToNum(BarDateTime.Format("%H%M%S"));
weekDay = DayofWeek(Date);
// Contract's Session Close
If (TimeHms >= 150000 And TimeHms <= 150059) Then
Begin
BuyToCover this bar on close;
Sell this bar on close;
End;
// Trading Dates
If Not ((dateYmd >= 19000101 And dateYmd <= 21001231)) Then
Begin
BuyToCover this bar on close;
Sell this bar on close;
End;
currentBarDTOHLCV = NumToStr(BarDateTime.ELDateTimeEx, 9) + NumToStr(Open, 9) + NumToStr(High, 9) + NumToStr(Low, 9) + NumToStr(Close, 9) + NumToStr(Volume, 9);
// Date and time check
If (dateYmd > beginDate And dateYmd <= endDate)
And (currentBarDTOHLCV <> lastBarDTOHLCV)
And (Not (TimeHms >= 150000 And TimeHms <= 150059)) Then
Begin
// Results and decisions
result = ((GSB_Norm2(GSB_SS_Stochastic(i1length) of Data1, 1, 100) of Data1 * i1Weight) * ((GSB_Norm2(GSB_RSI(Close, i2length) of Data2, 1, 100) of Data2 * i2Weight) * (GSB_Norm2(GSB_CloseLessPrevCloseD of Data2, 1, 100) of Data2 * i3Weight)));
result = IFF(AbsValue(result) > zs, result, 0);
decision = GSB_Decision(result, 2, entryLevel);
sfResult = GSB_Norm2(GSB_CloseLessPrevCloseD of Data1, 0, 100) of Data1 * iSFWeight;
sfResult = IFF(AbsValue(sfResult) > zs, sfResult, 0);
sfDecision = GSB_Decision(sfResult, 2, sfEntryLevel);
// Buy/Sell
If decision = 1 And sfDecision = 1 Then
Begin
Buy("Long entry") 1 contracts this bar on close;
End
Else If decision = -1 And sfDecision = -1 Then
Begin
SellShort("Short entry") 1 contracts this bar on close;
End;
End;
lastBarDTOHLCV = currentBarDTOHLCV;
|