¢£Â裴¾Ï Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // Re-Optimization Information: // // Reoptimize every 504 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 05/20/2027 // 05/02/2029 // 04/15/2031 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @NQ 1440min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 07-12-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/14/2025: Overnight Initial ($33820), Maint ($30745) | Day Initial ($3382), Maint ($3074) // // Strategy Settings // // Slippage : 15.00 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 72 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 0-5x1 // InputVar2, 0-5x1 // InputVar3, 1.5-3x1.5 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 1008/504 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input:ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(5), double InputVar2(0), double InputVar3(1.5); if ( date < 1150902 ) then begin InputVar1 = 5; InputVar2 = 0; InputVar3 = 1.5; end; // Walkforward dates and optimized parameters if date >= 1150902 and date < 1170816 then begin InputVar1 = 5; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1170816 and date < 1190731 then begin InputVar1 = 3; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1190731 and date < 1210713 then begin InputVar1 = 4; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1210713 and date < 1230623 then begin InputVar1 = 4; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1230623 and date < 1250606 then begin InputVar1 = 4; InputVar2 = 3; InputVar3 = 1.5; end; // // Next approximated optimization date based on trading days: 05/20/2027. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1250606 then begin InputVar1 = 4; InputVar2 = 3; InputVar3 = 1.5; end; if ( Date > 1150902) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// //STRAT //========================================================================== If DayOfWeek(Date) = InputVar1 and close> close [200] then buy ncons contracts next bar at market; If DayOfWeek(Date) = InputVar2 and close< close [200]then sellshort ncons contracts next bar at market; //========================================================================== //catastrophic stop of $5K if openpositionprofit<-5000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //ATR Target if openpositionprofit>InputVar3*2*AvgTrueRange(15)*BigPointValue*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; ¢£Â裵¾Ï Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // Re-Optimization Information: // // Reoptimize every 756 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 05/26/2027 // 04/30/2030 // 04/04/2033 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @PL 1440min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 07-12-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/15/2025: Overnight Initial ($5500), Maint ($5000) | Day Initial ($1375), Maint ($1250) // // Strategy Settings // // Slippage : 25.00 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 100 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 10-100x10 // InputVar2, 0-2x.5 // InputVar3, 1.5-3x1.5 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 1008/756 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input:ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(80), double InputVar2(1), double InputVar3(3); if ( date < 1150904 ) then begin InputVar1 = 80; InputVar2 = 1; InputVar3 = 3; end; // Walkforward dates and optimized parameters if date >= 1150904 and date < 1180810 then begin InputVar1 = 80; InputVar2 = 1; InputVar3 = 3; end; if date >= 1180810 and date < 1210716 then begin InputVar1 = 10; InputVar2 = 1.5; InputVar3 = 1.5; end; if date >= 1210716 and date < 1240620 then begin InputVar1 = 10; InputVar2 = 1.5; InputVar3 = 3; end; // // Next approximated optimization date based on trading days: 05/26/2027. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1240620 then begin InputVar1 = 30; InputVar2 = 1; InputVar3 = 1.5; end; if ( date>1150904) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// // start of entry rules Vars: RangeAvg(0); RangeAvg = Average(TrueRange, InputVar1); //STRAT //========================================================================== If RangeAvg < InputVar2 * Average(TrueRange, InputVar1 * 2) and Close > High[1] and cc[200] then sellshort ncons contracts next bar at market; //========================================================================== //catastrophic stop of $5K if openpositionprofit<-5000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //Dollar Target if openpositionprofit>InputVar3*1000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; ¢£Â裶¾Ï Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // // MultiWalk Strategy with Optimized Walkforward Parameters // // KJD2025-07 AI Book 02 (FixedVarSet 12) [@W-240min] WF(1008-756,U,NPAvgDD,PMx) // // This strategy is the result of the walkforward process and contains the walkforward optimized parameters for real-time // trading. Copy this strategy code to a new strategy (do not overwrite your MultiWalk version of this strategy). Give // it a unique name, such as the name above that uniquely identifies this walkforward strategy. // // Then add that strategy to a TradeStation chart. Configure the chart using the settings below. // // Walkforward Strategy Name : KJD2025-07 AI Book 02 (FixedVarSet 12) [@W-240min] WF(1008-756,U,NPAvgDD,PMx) // Walkforward Strategy File : KJD2025-07 AI Book 02 (FixedVarSet 12) [@W-240min] WF(1008-756,U,NPAvgDD,PMx) ELCode.txt // MultiWalk Strategy : KJD2025-07 AI Book 02 // MultiWalk Project Folder : C:\MultiOpt\Projects\KJD2025-07 AI Book 02-AI BookB\MultiWalk Projects\KJD2025-07 AI Book 02-AI BookB (FixedVarSet 12) // Code Generation Date : 07/15/2025 // MultiWalk Release : 12/19/2024 (DLL: 12/19/2024) // // Re-Optimization Information: // // Reoptimize every 756 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 12/13/2026 // 06/10/2029 // 12/07/2031 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @W 240min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 07-12-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/15/2025: Overnight Initial ($1705), Maint ($1550) | Day Initial ($1705), Maint ($1550) // // Strategy Settings // // Slippage : 15.00 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 100 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 10-100x10 // InputVar2, 0-2x.5 // InputVar3, 1.5-3x1.5 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 1008/756 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input:ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(100), double InputVar2(1), double InputVar3(1.5); if ( date < 1140623 ) then begin InputVar1 = 100; InputVar2 = 1; InputVar3 = 1.5; end; // Walkforward dates and optimized parameters if date >= 1140623 and date < 1161218 then begin InputVar1 = 100; InputVar2 = 1; InputVar3 = 1.5; end; if date >= 1161218 and date < 1190618 then begin InputVar1 = 50; InputVar2 = 1; InputVar3 = 1.5; end; if date >= 1190618 and date < 1211212 then begin InputVar1 = 50; InputVar2 = 1; InputVar3 = 3; end; if date >= 1211212 and date < 1240616 then begin InputVar1 = 60; InputVar2 = 1; InputVar3 = 3; end; // // Next approximated optimization date based on trading days: 12/13/2026. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1240616 then begin InputVar1 = 60; InputVar2 = 1; InputVar3 = 1.5; end; if ( date>1140623 ) then begin //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// // start of entry rules Vars: RangeAvg(0); RangeAvg = Average(TrueRange, InputVar1); //STRAT //========================================================================== If RangeAvg > InputVar2 * Average(TrueRange, InputVar1 * 2) and Close > High[1] and c InputVar2 * Average(TrueRange, InputVar1 * 2) and Close < Low[1] and c>c[200] then sellshort ncons contracts next bar at market; //========================================================================== //catastrophic stop of $5K if openpositionprofit<-5000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //50% Prof Protector if maxpositionprofit> InputVar3*1000*ncons and openpositionprofit<.5*maxpositionprofit then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; CHAPTER 7 - AI STRATEGY #4 - NG 240 MINUTE BAR Idea This strategy looks for higher than average volume with a small close to open range and close greater than previous close to go long. Plain English Rules 1. Run this strategy on NG (Natural Gas) 240 minute bars 2. If the current bar volume is greater than 2 times the average true range of the past 50 (currently, but can change with walkforward optimization) bars, and the absolute value of (close-open) is less than 20% of the 14 bar average true range, and the close is greater than the previous close, buy at the open of the next bar. 3. If the current bar volume is greater than 2 times the average true range of the past 50 (currently, but can change with walkforward optimization) bars, and the absolute value of (close-open) is less than 20% of the 14 bar average true range, and the close is less than the previous close, sellshort at the open of the next bar. 4. Stop Loss: NONE 5. Profit Target: If the dollars per contract open profit at close of bar is greater than 3 (currently, but can change with walkforward optimization) times the 14 bar average true range (converted to dollars), exit at next open. Sample Trade For the first buy signal, the high volume condition is met, the volatility is low and current close greater than the previous close. Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // // Re-Optimization Information: // // Reoptimize every 756 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 07/16/2026 // 12/21/2028 // 05/29/2031 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @NG 240min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 05-27-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 05/28/2025: Overnight Initial ($3758), Maint ($3416) | Day Initial ($1879), Maint ($1708) // // Strategy Settings // // Slippage : 17.50 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 54 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 10-50x5 // InputVar2, 3-8x1 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 1008/756 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input:ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(50), double InputVar2(4); // Seed initial values for time period BEFORE walkforward optimization. These values are from the first optimized iteration. InputVar1 = 50; InputVar2 = 4; if ( date < 1140514 ) then begin // Do not trade before the optimization parameters. Make this date InputVar1 = 50; InputVar2 = 4; end; // Walkforward dates and optimized parameters if date >= 1140514 and date < 1161018 then begin InputVar1 = 50; InputVar2 = 4; end; if date >= 1161018 and date < 1190327 then begin InputVar1 = 10; InputVar2 = 4; end; if date >= 1190327 and date < 1210901 then begin InputVar1 = 35; InputVar2 = 3; end; if date >= 1210901 and date < 1240208 then begin InputVar1 = 50; InputVar2 = 3; end; // // Next approximated optimization date based on trading days: 07/16/2026. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1240208 then begin InputVar1 = 50; InputVar2 = 3; end; if ( Date > 1140514 ) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// var: vol(0); vol=UpTicks+DownTicks; If Vol > 2*Average(Vol,InputVar1) and AbsValue(close-open)<.2*AvgTrueRange(14) and C>c[1] then buy ncons contracts next bar at market; If Vol > 2*Average(Vol,InputVar1) and AbsValue(close-open)<.2*AvgTrueRange(14) and CInputVar2*AvgTrueRange(14)*BigPointValue then begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; CHAPTER 8 - AI STRATEGY #5 - LC 180 MINUTE BAR Idea Buy signal when the RSI is low, the RSI is increasing and low is less than the previous low. Plain English Rules 1. Run this strategy on LC (Live Cattle) 180 minute bars 2. If the 14 bar RSI is less than 30 (currently, but can change with walkforward optimization) bars, and the 14 bar RSI is increasing from previous bar, and the current bar low is less than the previous bar low, buy at the open of the next bar. 3. If the 14 bar RSI is greater than 100 minus30 (currently, but can change with walkforward optimization) bars, and the 14 bar RSI is decreasing from previous bar, and the current bar high is greater than the previous bar high, sell short at the open of the next bar. 4. Stop Loss: NONE 5. Profit Target: If the dollars per contract open profit at close of bar is greater than 0.2 (currently, but can change with walkforward optimization) dollars (basically any profit above breakeven), exit at next open. Sample Trade For the first short signal, the RSI is above70 (the zero line in indicator), the RSI slope is down and the high is greater than the previous high. Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // Re-Optimization Information: // // Reoptimize every 504 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 05/30/2027 // 05/30/2029 // 05/31/2031 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @LC 180min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 06-23-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/08/2025: Overnight Initial ($3025), Maint ($2750) | Day Initial ($3025), Maint ($2750) // // Strategy Settings // // Slippage : 20.00 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 81 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 30-70x5 // InputVar2, .2-1x.1 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 1008/504 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input: ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(45), double InputVar2(0.2); if ( date < 1150526 ) then begin InputVar1 = 45; InputVar2 = 0.2; end; // the date of the first set of optimized parameters. // Walkforward dates and optimized parameters if date >= 1150526 and date < 1170524 then begin InputVar1 = 45; InputVar2 = 0.2; end; if date >= 1170524 and date < 1190524 then begin InputVar1 = 45; InputVar2 = 0.2; end; if date >= 1190524 and date < 1210525 then begin InputVar1 = 30; InputVar2 = 0.2; end; if date >= 1210525 and date < 1230525 then begin InputVar1 = 30; InputVar2 = 0.2; end; if date >= 1230525 and date < 1250529 then begin InputVar1 = 30; InputVar2 = 0.2; end; // // Next approximated optimization date based on trading days: 05/30/2027. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1250529 then begin InputVar1 = 30; InputVar2 = 0.2; end; if ( Date>1150526 ) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// //Hidden RSI Exhaustion Pivot If RSI(close,14)RSI(close,14)[1] and low100-InputVar1 and RSI(close,14)high[1] then sellshort ncons contracts next bar at market; //Profit Target if openPositionProfit/ncons>InputVar2 then Begin Sell next bar at market; BuyToCover Next bar at Market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; CHAPTER 9 - AI STRATEGY #6 - JY 1440 MINUTE BAR Idea Use a volume weighted reversal with momentum and ADX for signals. Plain English Rules 1. Run this strategy on JY (Japanese Yen) 1440 minute bars 2. Calculate the VWAP. If bar is for a new date, variables PriceW and ShareW are zero. Then, PriceW is previous PriceW + the average price of bar times the volume. ShareW is previous ShareW + volume. VWAP is PriceW / ShareW. 3. If the current position is flat and the close minus VWAP is less than 0.5 (currently, but can change with walkforward optimization) the 14 bar average true range, and the close is greater than the close 2 bars ago, and the 15 bar ADX is greater than 25, buy at the open of the next bar. 4. If the current position is flat and the close plus VWAP is greater than 0.5 (currently, but can change with walkforward optimization) the 14 bar average true range, and the close is less than the close 2 bars ago, and the 15 bar ADX is greater than 25, sell short at the open of the next bar. 5. Stop Loss: If the dollars per contract open profit at close of bar is less than -0.5*3000 (currently, but can change with walkforward optimization) dollars , exit at next open. 6. Profit Target: If the dollars per contract open profit at close of bar is greater than 3000 (currently, but can change with walkforward optimization) dollars, exit at next open. Sample Trade For the first buy shown, the VWAP condition is met, the 2 bar momentum is up and the ADX is greater than 25. Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // Re-Optimization Information: // // Reoptimize every 252 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 04/30/2025 // 04/21/2026 // 04/12/2027 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @JY 1440min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2006 // End Date (mm-dd-yyyy) : 12-31-2024 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 04/25/2025: Overnight Initial ($4180), Maint ($3800) | Day Initial ($2090), Maint ($1900) // // Strategy Settings // // Slippage : 15.00 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 30 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, .5-3x.5 // InputVar2, 1000-5000x1000 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 504/252 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input: ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(0.5), double InputVar2(3000); if ( date < 1090921 ) then begin InputVar1 = 0.5; InputVar2 = 3000; end; // Walkforward dates and optimized parameters if date >= 1090921 and date < 1100910 then begin InputVar1 = 0.5; InputVar2 = 3000; end; if date >= 1100910 and date < 1110901 then begin InputVar1 = 1; InputVar2 = 3000; end; if date >= 1110901 and date < 1120822 then begin InputVar1 = 1; InputVar2 = 5000; end; if date >= 1120822 and date < 1130814 then begin InputVar1 = 0.5; InputVar2 = 5000; end; if date >= 1130814 and date < 1140806 then begin InputVar1 = 0.5; InputVar2 = 5000; end; if date >= 1140806 and date < 1150728 then begin InputVar1 = 0.5; InputVar2 = 5000; end; if date >= 1150728 and date < 1160719 then begin InputVar1 = 0.5; InputVar2 = 5000; end; if date >= 1160719 and date < 1170711 then begin InputVar1 = 0.5; InputVar2 = 1000; end; if date >= 1170711 and date < 1180703 then begin InputVar1 = 0.5; InputVar2 = 2000; end; if date >= 1180703 and date < 1190625 then begin InputVar1 = 0.5; InputVar2 = 2000; end; if date >= 1190625 and date < 1200616 then begin InputVar1 = 0.5; InputVar2 = 2000; end; if date >= 1200616 and date < 1210607 then begin InputVar1 = 0.5; InputVar2 = 3000; end; if date >= 1210607 and date < 1220527 then begin InputVar1 = 0.5; InputVar2 = 2000; end; if date >= 1220527 and date < 1230518 then begin InputVar1 = 0.5; InputVar2 = 2000; end; if date >= 1230518 and date < 1240509 then begin InputVar1 = 0.5; InputVar2 = 3000; end; // // Next approximated optimization date based on trading days: 04/30/2025. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1240509 and date < 1250606 then begin InputVar1 = 0.5; InputVar2 = 3000; end; // Next approximated optimization date based on trading days: 05/28/2026. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. if date >= 1250606 and date < 1260528 then begin InputVar1 = 0.5; InputVar2 = 3000; End; if ( Date > 1090921) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// vars: VWAPh(0), PriceW(0), ShareW(0), Answer(0); if date > date[1] then begin PriceW = 0; ShareW = 0; end; PriceW = PriceW + (AvgPrice * (UpTicks+DownTicks)); ShareW = ShareW + (UpTicks+DownTicks); if ShareW > 0 then VWAPh = PriceW / ShareW; //Volume Weighted Reversal if marketposition=0 and close - VWAPh< InputVar1*AvgTrueRange(14) and Close>close[2] and ADX(15)>25 then buy ncons contracts next bar at market; If marketposition=0 and close + VWAPh> +InputVar1*AvgTrueRange(14) and Close25 then sellshort ncons contracts next bar at market; If openpositionprofit/ncons>InputVar2 or openpositionprofit/ncons<-.5*InputVar2 then begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; CHAPTER 10 - AI STRATEGY #7 - US 120 MINUTE BAR Idea The idea behind this strategy is pretty simple. There is a certain stretch of days during the week when it is better to be long, and a certain stretch where it is better to be short. Trade these days in the direction of the 200 bar momentum. Plain English Rules 1. Run this strategy on US (30 Year Treasury Bonds) 120 minute bars 2. If the day of the week is Sunday (currently, but can change with walkforward optimization) and the 200 bar momentum is up, buy at the open of the next bar. NOTE: there are Sunday night bars because of 6 PM Eastern Sunday open time. 3. If the day of the week is Monday (currently, but can change with walkforward optimization) and the 200 bar momentum is down, sellshort at the open of the next bar. 4. Stop Loss: If the per contract open profit at close of bar is less than -5000, exit at the next open. 5. Profit Target: If the per contract open profit at close of bar is greater than 3 (currently, but can change with walkforward optimization) times 1000 dollars, exit at next open. Sample Trade For the short trade shown, it enters on a Monday, with the 200 bar momentum down. A few weeks later, on a Sunday night it reverse to long when the 200 bar momentum is positive. Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // Re-Optimization Information: // // Reoptimize every 504 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 08/29/2025 // 04/12/2027 // 11/23/2028 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @US 120min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 07-12-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/14/2025: Overnight Initial ($4070), Maint ($3700) | Day Initial ($2035), Maint ($1850) // // Strategy Settings // // Slippage : 32.50 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 72 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 0-5x1 // InputVar2, 0-5x1 // InputVar3, 1.5-3x1.5 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 1008/504 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input: ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(4), double InputVar2(5), double InputVar3(3); if ( date < 1140427 ) then begin InputVar1 = 4; InputVar2 = 5; InputVar3 = 3; end; // Walkforward dates and optimized parameters if date >= 1140427 and date < 1151206 then begin InputVar1 = 4; InputVar2 = 5; InputVar3 = 3; end; if date >= 1151206 and date < 1170723 then begin InputVar1 = 4; InputVar2 = 5; InputVar3 = 1.5; end; if date >= 1170723 and date < 1190306 then begin InputVar1 = 5; InputVar2 = 2; InputVar3 = 1.5; end; if date >= 1190306 and date < 1201018 then begin InputVar1 = 4; InputVar2 = 2; InputVar3 = 1.5; end; if date >= 1201018 and date < 1220602 then begin InputVar1 = 4; InputVar2 = 2; InputVar3 = 1.5; end; if date >= 1220602 and date < 1240116 then begin InputVar1 = 4; InputVar2 = 2; InputVar3 = 1.5; end; // // if date >= 1240116 and date < 1250828 then begin InputVar1 = 1; InputVar2 = 0; InputVar3 = 3; end; // Next approximated optimization date based on trading days: 004/11/2027. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1250828 {and date < 1270411} then begin InputVar1 = 1; InputVar2 = 3; InputVar3 = 1.5; end; if ( date>1140427 ) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// // start of entry rules //========================================================================== If DayOfWeek(Date) = InputVar2 and c>c[200] then buy ncons contracts next bar at market; If DayOfWeek(Date) = InputVar1 and cInputVar3*1000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; CHAPTER 11 - AI STRATEGY #8 - GC 1440 MINUTE BAR Idea Look for lower than average range, and a nice up bar to go long. Vice versa to go short. Plain English Rules 1. Run this strategy on GC (Gold) 1440 minute bars 2. If the 50 bar (currently, but can change with walkforward optimization) average of true range is less than 1 (currently, but can change with walkforward optimization) times the 100 bar (can change with walkforward) average of true range and the close is greater than the previous high, buy at the open of the next bar. 3. If the 50 bar (currently, but can change with walkforward optimization) average of true range is less than 1 (currently, but can change with walkforward optimization) times the 100 bar (can change with walkforward) average of true range and the close is less than the previous low, sell short at the open of the next bar. 4. Stop Loss: If the per contract open profit at close of bar is less than -5000, exit at the next open. 5. Profit Target: If the dollars per contract open profit at close of bar is greater than 3 (currently, but can change with walkforward optimization) times 2 times the 15 bar average true range, exit at next open. Sample Trade Here is an example trade. For the buy signal shown, you see the range is below average and close of the signal bar is greater than the previous high. Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // Re-Optimization Information: // // Reoptimize every 252 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 06/03/2026 // 05/25/2027 // 05/15/2028 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @GC 1440min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 07-10-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/14/2025: Overnight Initial ($16500), Maint ($15000) | Day Initial ($1650), Maint ($1500) // // Strategy Settings // // Slippage : 30.00 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 100 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 10-100x10 // InputVar2, 0-2x.5 // InputVar3, 1.5-3x1.5 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 504/252 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Optimization variables for this walkforward strategy. vars: double InputVar1(40), double InputVar2(1), double InputVar3(3); if ( date < 1130920 ) then begin InputVar1 = 40; InputVar2 = 1; InputVar3 = 3; end; // Walkforward dates and optimized parameters if date >= 1130920 and date < 1140912 then begin InputVar1 = 40; InputVar2 = 1; InputVar3 = 3; end; if date >= 1140912 and date < 1150904 then begin InputVar1 = 90; InputVar2 = 1; InputVar3 = 3; end; if date >= 1150904 and date < 1160826 then begin InputVar1 = 10; InputVar2 = 1; InputVar3 = 1.5; end; if date >= 1160826 and date < 1170818 then begin InputVar1 = 90; InputVar2 = 1; InputVar3 = 1.5; end; if date >= 1170818 and date < 1180810 then begin InputVar1 = 100; InputVar2 = 1; InputVar3 = 3; end; if date >= 1180810 and date < 1190802 then begin InputVar1 = 80; InputVar2 = 1; InputVar3 = 1.5; end; if date >= 1190802 and date < 1200724 then begin InputVar1 = 40; InputVar2 = 1; InputVar3 = 1.5; end; if date >= 1200724 and date < 1210716 then begin InputVar1 = 30; InputVar2 = 1; InputVar3 = 1.5; end; if date >= 1210716 and date < 1220707 then begin InputVar1 = 40; InputVar2 = 1; InputVar3 = 3; end; if date >= 1220707 and date < 1230629 then begin InputVar1 = 60; InputVar2 = 1; InputVar3 = 1.5; end; if date >= 1230629 and date < 1240620 then begin InputVar1 = 70; InputVar2 = 1; InputVar3 = 3; end; if date >= 1240620 and date < 1250612 then begin InputVar1 = 70; InputVar2 = 1; InputVar3 = 1.5; end; // // Next approximated optimization date based on trading days: 06/03/2026. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1250612 then begin InputVar1 = 50; InputVar2 = 1; InputVar3 = 3; end; if ( date>1130920 ) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// //IstratVersion=1 to 4 //IMonthlySwitch=0,1500,3000 (profit per month when you cease) //IRegime=0,1 //IExit=1 to 3 //InputVar1 - strategy specific value //InputVar2 - strategy entry specific value //InputVar3 - strategy exit specific value, 1.5-3 input:ncons(1); //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// // start of entry rules Vars: RangeAvg(0); RangeAvg = Average(TrueRange, InputVar1); //========================================================================== If RangeAvg < InputVar2 * Average(TrueRange, InputVar1 * 2) and Close > High[1] then buy ncons contracts next bar at market; If RangeAvg < InputVar2 * Average(TrueRange, InputVar1 * 2) and Close < Low[1] then sellshort ncons contracts next bar at market; //========================================================================== //catastrophic stop of $5K if openpositionprofit<-5000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //ATR Target if openpositionprofit>InputVar3*2*AvgTrueRange(15)*BigPointValue*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; CHAPTER 12 - AI STRATEGY #9 - NQ 720 MINUTE BAR Idea Enter long on close of first Monday bar of day. Exit with big stop or profit target. No short trades Plain English Rules 1. Run this strategy on NQ (mini Nasdaq) 720 minute bars 2. If the day of the week is Monday (currently, but can change with walkforward optimization), buy at the open of the next bar. NOTE: No short trades. 3. Stop Loss: If the per contract open profit at close of bar is less than -5000, exit at the next open. 4. Profit Target: If the per contract open profit at close of bar is greater than 3 (currently, but can change with walkforward optimization) times 1000 dollars, exit at next open. Sample Trade For the long trade shown, it enters on the close of the first Monday bar, and holds until stop or target is hit. Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // // Re-Optimization Information: // // Reoptimize every 504 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 12/29/2026 // 12/10/2028 // 11/22/2030 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @NQ 720min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 07-10-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/14/2025: Overnight Initial ($34082), Maint ($30984) | Day Initial ($3408), Maint ($3098) // // Strategy Settings // // Slippage : 15.00 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 72 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 0-5x1 // InputVar2, 0-5x1 // InputVar3, 1.5-3x1.5 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 1008/504 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Optimization variables for this walkforward strategy. vars: double InputVar1(2), double InputVar2(0), double InputVar3(1.5); if ( date < 1150415 ) then begin InputVar1 = 2; InputVar2 = 0; InputVar3 = 1.5; end; // Walkforward dates and optimized parameters if date >= 1150415 and date < 1170328 then begin InputVar1 = 2; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1170328 and date < 1190312 then begin InputVar1 = 1; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1190312 and date < 1210223 then begin InputVar1 = 1; InputVar2 = 0; InputVar3 = 3; end; if date >= 1210223 and date < 1230203 then begin InputVar1 = 1; InputVar2 = 0; InputVar3 = 3; end; if date >= 1230203 and date < 1250116 then begin InputVar1 = 1; InputVar2 = 0; InputVar3 = 1.5; end; // // Next approximated optimization date based on trading days: 12/29/2026. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1250116 then begin InputVar1 = 1; InputVar2 = 0; InputVar3 = 3; end; if ( date>1150415 ) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// input:ncons(1); //STRAT //========================================================================== If DayOfWeek(Date) = InputVar1 then buy ncons contracts next bar at market; If DayOfWeek(Date) = InputVar2 then sellshort ncons contracts next bar at market; //========================================================================== //catastrophic stop of $5K if openpositionprofit<-5000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; if openpositionprofit>InputVar3*1000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; CHAPTER 13 - AI STRATEGY #10 - CL 120 MINUTE BAR Idea Use ADX, simple double momentum, long term momentum for signals. Also include a switch to turn off strategy for month if profit threshold is reached. Plain English Rules 1. Run this strategy on CL (Crude Oil) 120 minute bars 2. If 14 bar ADX is less than 10 (currently, but can change with walkforward optimization), the current close is greater than previous close and the previous close is greater than the close 2 bars ago and the current close is greater than the close 200 bars ago, buy at the open of the next bar. 3. If 14 bar ADX is less than 10 (currently, but can change with walkforward optimization), the current close is less than previous close and the previous close is less than the close 2 bars ago and the current close is less than the close 200 bars ago, sell short at the open of the next bar. 4. Stop Loss: If the per contract open profit at close of bar is less than -5000, exit at the next open. 5. Profit Target: If the dollars per contract open profit at close of bar is greater than 3 (currently, but can change with walkforward optimization) times 1000 dollars, exit at next open. 6. Every bar, check the total profit during the month. If the total open plus closed equity during the month is greater than $3000 per contract, then exit any open trades and do not take any new trades until the following month. Sample Trade Here is an example trade. For the buy signal shown, you see the range is below average and close of the signal bar is greater than the previous high. Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // Re-Optimization Information: // // Reoptimize every 504 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 08/28/2025 // 04/12/2027 // 11/24/2028 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @CL 120min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 07-14-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/16/2025: Overnight Initial ($6808), Maint ($6189) | Day Initial ($1702), Maint ($1547) // // Strategy Settings // // Slippage : 15.00 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 30 // Optimized/Fixed Input Parameters (variable name and range/step increments) // iStratVersion, 3 // iExit, 2 // iMonthlySwitch, 3000 // iRegime, 1 // InputVar1, 2-30x2 // InputVar2, 0 // InputVar3, 1.5-3x1.5 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 1008/504 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input: ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(24), double InputVar2(0), double InputVar3(1.5); if ( date < 1140421 ) then begin InputVar1 = 24; InputVar2 = 0; InputVar3 = 1.5; end; // Walkforward dates and optimized parameters if date >= 1140421 and date < 1151201 then begin InputVar1 = 24; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1151201 and date < 1170718 then begin InputVar1 = 12; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1170718 and date < 1190301 then begin InputVar1 = 24; InputVar2 = 0; InputVar3 = 3; end; if date >= 1190301 and date < 1201013 then begin InputVar1 = 20; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1201013 and date < 1220530 then begin InputVar1 = 20; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1220530 and date < 1240114 then begin InputVar1 = 10; InputVar2 = 0; InputVar3 = 1.5; end; // if date >= 1240114 and date < 1250826 then begin InputVar1 = 10; InputVar2 = 0; InputVar3 = 1.5; end; // Next approximated optimization date based on trading days: 04/10/2027. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. if date >= 1250826 {and date < 1270410} then begin InputVar1 = 12; InputVar2 = 0; InputVar3 = 3; end; if ( date > 1140421 ) then begin ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MAIN STRATEGY LOGIC // ///////////////////////////////////////////////////////////////////////////////////////////// CodeBlockBegin ///// var: CurrentEquity(0),CurrentMonth(0),NewMonthEquity(0); CurrentEquity = NetProfit + OpenPositionProfit; CurrentMonth = Month(date); If CurrentMonth<>CurrentMonth[1] then Begin NewMonthEquity = CurrentEquity[1]; end; Var:CanTradeMonthly(False); CanTradeMonthly=True; //IMonthlySwitch=0 (off), 1500, 3000 If CurrentEquity - NewMonthEquity > 3000*ncons then Begin CanTradeMonthly=False; End; //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// // start of entry rules if CanTradeMonthly then begin //STRAT //========================================================================== If ADX(14) < InputVar1 and Close > Close[1] and Close[1] > Close[2] and c>c[200] then buy ncons contracts next bar at market; If ADX(14) < InputVar1 and Close < Close[1] and Close[1] < Close[2] and cInputVar3*1000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end; CHAPTER 14 - AI STRATEGY #11 - CD 1440 MINUTE BAR Idea Use ADX, simple double momentum. Also include a switch to turn off strategy for month if profit threshold is reached. Plain English Rules 1. Run this strategy on CD (Canadian Dollar) 1440 minute bars 2. If 14 bar ADX is greater than 26 (currently, but can change with walkforward optimization), the current close is less than previous close and the previous close is less than the close 2 bars ago, buy at the open of the next bar. 3. If 14 bar ADX is greater than 26 (currently, but can change with walkforward optimization), the current close is greater than previous close and the previous close is greater than the close 2 bars ago, sell short at the open of the next bar. 4. Stop Loss: If the per contract open profit at close of bar is less than -5000, exit at the next open. 5. Profit Target: If the dollars per contract open profit at close of bar is greater than 1.5 (currently, but can change with walkforward optimization) times 1000 dollars, exit at next open. 6. Every bar, check the total profit during the month. If the total open plus closed equity during the month is greater than $3000 per contract, then exit any open trades and do not take any new trades until the following month. Sample Trade Here is an example trade. For the buy signal shown, you see the range is below average and close of the signal bar is greater than the previous high. Tradestation Easy Language Code // Copyright KJTradingSystems.com // Kevin Davey kdavey@kjtradingsystems.com // Use at your own risk. For educational purposes only. // // Strategy built with MultiWalk - Multiwalk.net // Multiwalk only available for students of the Strategy Factory workshop (https://kjtradingsystems.com/strategy-workshop.html) // // // // Re-Optimization Information: // // Reoptimize every 252 Trading Days // The following dates are an approximation and may not account for holidays, so may be +/- a few days in either direction. // // Next approximated re-optimization dates: // 05/28/2026 // 05/19/2027 // 05/09/2028 // // TRADESTATION CHART SETUP INFORMATION // // Be sure to configure the chart in TradeStation using the SAME settings that were used in MultiWalk, otherwise // your results will not match those found in MultiWalk. Use the settings below to create your TradeStation chart. // ------------------------------------------------------------------------------------------------------------------ // // Symbol Settings // // Symbol/Interval/Session Data1 : @CD 1440min (Regular Session) // Symbol/Interval/Session Data2 : // Symbol/Interval/Session Data3 : // Symbol/Interval/Session Data4 : // Begin Date (mm-dd-yyyy) : 12-31-2010 // End Date (mm-dd-yyyy) : 07-14-2025 // Time Zone : Exchange Time // Bar Building Method : Session Hours // For Volume, Use : Trade Vol // Futures Margin : As of 07/16/2025: Overnight Initial ($1485), Maint ($1350) | Day Initial ($742), Maint ($675) // // Strategy Settings // // Slippage : 12.50 ($ per share/contract) // Commission : 2.50 ($ per share/contract) // Limit Order Fill Assumption : Fill order when price exeeds limit price // Maximum number of bars (MaxBarsBack): 200 // Look-Inside-Bar Backtesting (LIBB) : No // Multiple position/pyramiding enabled: No // // OPTIMIZATION/WALKFORWARD INFORMATION // // The following are the optimization and walkforward settings used in MultiWalk to create this strategy. They can // be used to create a MultiWalk project for reoptimization. // ------------------------------------------------------------------------------------------------------------------ // // Optimization Settings // // Total number of iterations : 30 // Optimized/Fixed Input Parameters (variable name and range/step increments) // InputVar1, 2-30x2 // InputVar2, 0 // InputVar3, 1.5-3x1.5 // // Walkforward Settings // // Anchored/Unanchored : Unanchored // Fitness Function : NP/Avg DD (Best ROA using avg DD (return on account: net profit return / daily average drawdown)) // In/Out Periods : 504/252 // ReOpt Position Matching Mode : None // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////// WALKFORWARD OPTIMIZED VARIABLES ////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// input:ncons(1); // Optimization variables for this walkforward strategy. vars: double InputVar1(24), double InputVar2(0), double InputVar3(3); if ( date < 1130919 ) then begin InputVar1 = 24; InputVar2 = 0; InputVar3 = 3; end; // Walkforward dates and optimized parameters if date >= 1130919 and date < 1140911 then begin InputVar1 = 24; InputVar2 = 0; InputVar3 = 3; end; if date >= 1140911 and date < 1150902 then begin InputVar1 = 24; InputVar2 = 0; InputVar3 = 3; end; if date >= 1150902 and date < 1160824 then begin InputVar1 = 24; InputVar2 = 0; InputVar3 = 3; end; if date >= 1160824 and date < 1170816 then begin InputVar1 = 28; InputVar2 = 0; InputVar3 = 3; end; if date >= 1170816 and date < 1180808 then begin InputVar1 = 30; InputVar2 = 0; InputVar3 = 3; end; if date >= 1180808 and date < 1190731 then begin InputVar1 = 30; InputVar2 = 0; InputVar3 = 3; end; if date >= 1190731 and date < 1200722 then begin InputVar1 = 22; InputVar2 = 0; InputVar3 = 3; end; if date >= 1200722 and date < 1210713 then begin InputVar1 = 14; InputVar2 = 0; InputVar3 = 3; end; if date >= 1210713 and date < 1220704 then begin InputVar1 = 14; InputVar2 = 0; InputVar3 = 3; end; if date >= 1220704 and date < 1230623 then begin InputVar1 = 14; InputVar2 = 0; InputVar3 = 3; end; if date >= 1230623 and date < 1240614 then begin InputVar1 = 22; InputVar2 = 0; InputVar3 = 1.5; end; if date >= 1240614 and date < 1250606 then begin InputVar1 = 22; InputVar2 = 0; InputVar3 = 1.5; end; // // Next approximated optimization date based on trading days: 05/28/2026. This date is an approximation and does not account for exact holidays, so may be +/- a few days in either direction. // if date >= 1250606 then begin InputVar1 = 26; InputVar2 = 0; InputVar3 = 1.5; end; if ( date > 1130919 ) then begin var: CurrentEquity(0),CurrentMonth(0),NewMonthEquity(0); CurrentEquity = NetProfit + OpenPositionProfit; CurrentMonth = Month(date); If CurrentMonth<>CurrentMonth[1] then Begin NewMonthEquity = CurrentEquity[1]; end; Var:CanTradeMonthly(False); CanTradeMonthly=True; If CurrentEquity - NewMonthEquity > 3000*ncons then Begin CanTradeMonthly=False; End; //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// //\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/\/\/\/\/\/\/\/\/\/\/\/// // start of entry rules if CanTradeMonthly then begin //STRAT //========================================================================== If ADX(14) > InputVar1 and Close < Close[1] and Close[1] < Close[2] then buy ncons contracts next bar at market; If ADX(14) > InputVar1 and Close > Close[1] and Close[1] > Close[2] then sellshort ncons contracts next bar at market; //========================================================================== end; //oktrade and cantrademonthly //monthly cease trading If CanTradeMonthly=false then Begin sell ("Monthly Cease") ncons contracts next bar at market; buytocover ("Monthly Cease2") ncons contracts next bar at market; End; //catastrophic stop of $5K if openpositionprofit<-5000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //Dollar Target if openpositionprofit>InputVar3*1000*ncons then Begin sell ncons contracts next bar at market; buytocover ncons contracts next bar at market; end; //// CodeBlockEnd //////////////////////////////////////////////////////////////////////////////////////////////// end;