// If the line below does not compile, please import the latest script file from C:\dropbox\GSB\GSB (Managers)\TradeStation
Code\GSB_Scripts_2018_01_01.eld
Value1 = GSB_Scripts_2018_01_01;
// 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;
// Result and decision
result = ((GSB_Norm2(RateOfChange(Close, i1length) of Data(i1Data), 10, 100) of Data(i1Data) * i1Weight) * ((GSB_Norm2(GSB_CloseOverPrevCloseD of
Data(i2Data), 10, 100) of Data(i2Data) * i2Weight) * (GSB_Norm2(XAverage(Close, i3length) of Data(i3Data), 10, 100) of Data(i3Data) * i3Weight)));
result = IFF(AbsValue(result) > zs, result, 0);
decision = GSB_Decision(result, 1, entryParams);
// Date and time check
If (dateYmd > beginDate And dateYmd <= endDate)
And (currentBarDTOHLCV <> lastBarDTOHLCV)
And (Not (TimeHms >= 150000 And TimeHms <= 150059)) Then
Begin
// 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;
Carl - 11-2-2018 at 09:01 AM
Hi jln780,
Please see the comments at the top of your TS code:
This strategy needs a chart in Tradestation with three graphs namely:
Data1: ES.30.Minute.830.1500.CentralUSATime.txt,
Data2: idx.30.Minute.830.1500.CentralUSATime.txt,
Data3: spx.30.Minute.830.1500.CentralUSATime.txt
Carl
importing indicator
jln780 - 12-2-2018 at 10:26 AM
Carl, Thank you.
Got it!
Another newbie question:
-How do I import my TS indicators library into GSB?
Thanks,
JL