{------------------------------------------------------------------------------- Trading Strategy Code Population member: 156 Max bars back: 100 Created by: Adaptrade Builder version 1.7.2.1 Created: 2/19/2015 5:46:07 AM Scripting language: TradeStation 6 or newer Price files: EURUSD-240-TS.txt EURUSD240.csv Build dates: 11/14/2011 to 12/12/2013 Project file: C:\...\Adaptrade\HybridNN\HybridNN.gpstrat -------------------------------------------------------------------------------} { Strategy inputs } Inputs: NL1 (16), { Indicator look-back length (bars), long trades } NL2 (5), { Day of week (0 to 6 for Sunday to Saturday), long trades } NL3 (18), { Indicator look-back length (bars), long trades } NL4 (81), { Indicator look-back length (bars), long trades } NL5 (4), { Indicator look-back length (bars), long trades } NL6 (100), { Indicator look-back length (bars), long trades } NL7 (57), { Indicator look-back length (bars), long trades } NL8 (62), { Indicator look-back length (bars), long trades } NL9 (67), { Indicator look-back length (bars), long trades } NL10 (34), { Indicator look-back length (bars), long trades } NL11 (4), { Day of week (0 to 6 for Sunday to Saturday), long trades } XL1 (3.0000), { Number of standard deviations, long trades } ShiftL1 (13), { Indicator shift value (bars), long trades } ShiftL2 (17), { Indicator shift value (bars), long trades } ShiftL3 (14), { Indicator shift value (bars), long trades } ShiftL4 (15), { Indicator shift value (bars), long trades } ShiftL5 (19), { Indicator shift value (bars), long trades } NS1 (59), { Indicator look-back length (bars), short trades } NS2 (5), { Price pattern look-back length (bars), short trades } Wgt1 (-0.1480), { Neural network weight value (-1 to 1) } Wgt2 (-0.2172), { Neural network weight value (-1 to 1) } Wgt3 (-0.4254), { Neural network weight value (-1 to 1) } Wgt4 (-0.5144), { Neural network weight value (-1 to 1) } Wgt5 (-0.0287), { Neural network weight value (-1 to 1) } Wgt6 (0.2224), { Neural network weight value (-1 to 1) } Wgt7 (-0.3087), { Neural network weight value (-1 to 1) } Wgt8 (-0.5567), { Neural network weight value (-1 to 1) } Wgt9 (0.2203), { Neural network weight value (-1 to 1) } Wgt10 (-0.5853), { Neural network weight value (-1 to 1) } PSParam (100000.00), { Position sizing parameter value } RoundPS (true), { Round-to-nearest (true/false) } RoundTo (1), { Round-to position size value } MinSize (1), { Minimum allowable position size } SizeLimit (100000); { Maximum allowable position size } { Variables for entry and exit conditions } Var: VarL1 (0), VarL2 (0), VarL3 (0), VarL10 (0), VarL11 (0), VarL15 (0), VarS1 (0), VarS2 (0), VarS3 (0), VarS4 (0), EntCondL (false), EntCondS (false); { Variables for position sizing } Var: NShares (0); { Entry and exit conditions } VarL1 = TrueRange; VarL2 = StandardDev(H, NL1, 1)[ShiftL1]; VarS1 = AvgTrueRange(NS1); VarS2 = H[NS2]; VarS3 = VarS1 + VarS2; VarS4 = LowD(0); EntCondL = VarL1 < VarL2; EntCondS = VarS3 > VarS4; { Neural network inputs } Array: NNInputs[10](0); VarL3 = DayOfWeek(date); VarL10 = ZLTrend(H, NL8)[ShiftL4]; VarL11 = HighD(0); VarL15 = DayOfWeek(date); NNInputs[0] = VarL3 - NL2; NNInputs[1] = InvFisherCycle(O, NL3); NNInputs[2] = BollingerBand(L, NL4, XL1); NNInputs[3] = InvFisherRSI(L, NL5)[ShiftL2]; NNInputs[4] = InvFisherCycle(L, NL6); NNInputs[5] = ZLTrend(H, NL7)[ShiftL3]; NNInputs[6] = VarL10 - VarL11; NNInputs[7] = StandardDev(O, NL9, 1); NNInputs[8] = InvFisherRSI(O, NL10)[ShiftL5]; NNInputs[9] = VarL15 - NL11; { Evaluate neural network function } Array: NNWeights[10](0); Var: NNOutput(0); NNWeights[0] = Wgt1; NNWeights[1] = Wgt2; NNWeights[2] = Wgt3; NNWeights[3] = Wgt4; NNWeights[4] = Wgt5; NNWeights[5] = Wgt6; NNWeights[6] = Wgt7; NNWeights[7] = Wgt8; NNWeights[8] = Wgt9; NNWeights[9] = Wgt10; NNOutput = NNCompute(NNInputs, 10, NNWeights, 10, 100); { Position sizing calculations } NShares = PSParam; If RoundPS and RoundTo > 0 then NShares = IntPortion(NShares/RoundTo) * RoundTo; NShares = MaxList(NShares, MinSize); NShares = MinList(NShares, SizeLimit); { Entry orders } If EntCondL and NNOutput >= 0.5 then begin Buy("EnMark-L") NShares shares next bar at market; end; If EntCondS and NNOutput <= -0.5 then begin Sell short("EnMark-S") NShares shares next bar at market; end;