GSB Forums

Tried to reference a data stream who doesn't exist

jln780 - 11-2-2018 at 08:26 AM

When I ran the strategy created by GSB in TS for @ES -30 min, I get the error message "Tried to reference a data stream who doesn't exist"

Event:
Error:elsystem.DataDeletedException:Tried to reference a data stream that does not exist.Call Stack:Rate of Change.main0ELRte

// Settings
// ID: 20180210-212814-426207-D8jGq
// Info: File Name Prefix: , Comment: , Workplace Instance ID: c5VpF7vmlljA4tsyr, Machine Name: DESKTOP-B11UR7P
// 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: 0
// Reports Commission: 0
// Commission Mode: TradePerSide
// Fitness Slippage: 0
// Reports Slippage: 0
// Slippage Mode: TradePerSide
// Long Trading Allowed: True
// Short Trading Allowed: True
// Max. Entries per Day:
// GSB Version: 1.0.42.14 / 2018-01-03

// Performance (full period)
// Fitness: 13,836,601.98
// Net Profit: 107,487.5
// Commission (in $): 0
// Drawdown: -4,987.5
// Avg Trade: 128.73
// Percent Profitable: 60.6
// Pearson: 0.994
// Profit Factor: 1.91
// Trades Count: 835
// Net Profit / -Drawdown: 21.55

// Inputs
Inputs:
i1Data(3),
i1length(49),
i2Data(3),
i3Data(2),
i3length(133),
i1Weight(-1),
i2Weight(1),
i3Weight(1),
entryParams(0),
iSFData(1),
iSFWeight(1),
sfEntryLevel(14),
beginDate(20010618),
endDate(20170228);

// Vars
Vars:
id("20180210-212814-426207-D8jGq"),
debugScriptPath("C:\dropbox\GSB\GSB (Managers)\Data\Debugs\20180210-212814-426207-D8jGq.ts.txt"),
dateYmd(0),
timeHms(0),
weekDay(0),
currentBarDTOHLCV(""),
lastBarDTOHLCV(""),
result(0),
sfResult(0),
decision(0),
sfDecision(0),
tradeExitTime(1000000000),
zs(0.0000000001);

// 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);

sfResult = GSB_Norm2(GSB_CloseLessPrevCloseD of Data(iSFData), 0, 100) of Data(iSFData) * iSFWeight;
sfResult = IFF(AbsValue(sfResult) > zs, sfResult, 0);
sfDecision = GSB_Decision(sfResult, 1, sfEntryLevel);

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
// 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:

// 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

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



admin - 12-2-2018 at 03:04 PM

Quote: Originally posted by jln780  
Carl, Thank you.
Got it!
Another newbie question:
-How do I import my TS indicators library into GSB?
Thanks,
JL



http://www.trademaid.info/forum/viewthread.php?tid=28