TradeStation Strategy Not Working? 9 Common Fixes That Actually Work

Krisz
9 min read
TradeStation Strategy Not Working? 9 Common Fixes That Actually Work

You've spent hours building your TradeStation strategy. The backtest looked promising. You applied it to a chart and... nothing. No trades. No signals. Just a flat equity curve staring back at you.

Before you throw your keyboard across the room, take a breath. In my 15 years of developing EasyLanguage strategies, I've seen every possible way a strategy can fail to work. The good news? Most issues have simple fixes once you know where to look.

This guide walks you through the nine most common reasons your TradeStation strategy isn't working and how to fix each one.

1. The Strategy Isn't Actually Turned On

This sounds obvious, but it's the #1 issue I see with new traders. TradeStation has multiple layers of "on" switches, and missing any one of them means your strategy sits idle.

Here's your checklist:

First, check that automation is enabled globally. Go to View > TradeStation Automation and ensure the automation panel shows "On." If it says "Off," click to toggle it.

Second, verify the strategy is turned on for your specific chart. Right-click your chart, select Format Strategies, find your strategy in the list, and confirm the checkbox next to it is checked.

Third, check that the strategy status shows "Strategy On" in the Format Strategies window. If it shows "Strategy Off," click the status to toggle it.

A quick way to verify everything is working: look for the small triangle icon in the upper-left corner of your chart. Green means the strategy is active and ready to trade. Red or gray means something is disabled.

2. Insufficient Historical Data

Your strategy needs enough historical bars to calculate its indicators before it can generate signals. If you're using a 200-period moving average on a 5-minute chart, you need at least 200 bars of data before your strategy can even begin to evaluate conditions.

Check your data settings by right-clicking the chart and selecting Format Symbol. Look at the "Days Back" or "Bars Back" setting. For most strategies, I recommend loading at least 90 days of intraday data or 3-5 years of daily data.

You can also add a safety check to your code to prevent errors when there's insufficient data:

// Ensure enough bars are loaded before calculating
If CurrentBar < 200 then Exit;

// Now safe to use indicators requiring 200 bars
Variables:
    SlowMA(0);

SlowMA = Average(Close, 200);

The CurrentBar variable tells you how many bars have loaded. By exiting early when there aren't enough bars, you prevent calculation errors and false signals.

3. Order Syntax Errors

EasyLanguage is particular about order syntax. A misplaced word can mean the difference between a trade executing and nothing happening at all.

Here's a common mistake:

// WRONG - This will not execute
If Condition then Buy at Market;

// CORRECT - Include "next bar"
If Condition then Buy next bar at Market;

The phrase "next bar" is critical for most order types. Without it, TradeStation doesn't know when to execute the order.

Here are the correct patterns for common order types:

// Market orders
Buy next bar at market;
Sell next bar at market;
SellShort next bar at market;
BuyToCover next bar at market;

// Limit orders
Buy next bar at 4500.00 limit;
Sell next bar at 4600.00 limit;

// Stop orders
Buy next bar at 4550.00 stop;
Sell next bar at 4450.00 stop;

If you're using calculated values for entry prices, make sure you're not generating impossible prices. A limit buy order above the current market or a stop sell order above the current market will never fill.

4. Position Conflicts

TradeStation prevents conflicting orders by default. If your strategy tries to go long while already holding a short position (without closing it first), the order may be rejected or behave unexpectedly.

The cleanest approach is to explicitly manage your position state:

// Track current position
Variables:
    CurrentPosition(0);  // 1 = long, -1 = short, 0 = flat

// Entry logic with position awareness
If CurrentPosition = 0 and LongCondition then begin
    Buy next bar at market;
    CurrentPosition = 1;
end;

If CurrentPosition = 0 and ShortCondition then begin
    SellShort next bar at market;
    CurrentPosition = -1;
end;

// Exit logic
If CurrentPosition = 1 and ExitLongCondition then begin
    Sell next bar at market;
    CurrentPosition = 0;
end;

If CurrentPosition = -1 and ExitShortCondition then begin
    BuyToCover next bar at market;
    CurrentPosition = 0;
end;

Alternatively, you can use TradeStation's built-in MarketPosition function to check your current state:

// Only enter long if flat
If MarketPosition = 0 and LongCondition then
    Buy next bar at market;

MarketPosition returns 1 for long, -1 for short, and 0 for flat.

5. The "MaxBarsBack" Setting Is Too Low

MaxBarsBack tells TradeStation how many historical bars to reserve for calculations. If your indicator needs 50 bars but MaxBarsBack is set to 20, your strategy will fail silently.

To check this setting, right-click your chart, select Format Strategies, click on your strategy, and look for "Max bars study will reference."

You can also set it explicitly in your code:

[MaxBarsBack = 100]

// Your strategy code here

I recommend setting MaxBarsBack to at least 20% higher than your longest lookback period. If you're using a 200-period moving average, set MaxBarsBack to at least 250.

6. Time and Session Filters Blocking Trades

If your strategy includes time filters or session restrictions, it may be filtering out all potential trades without you realizing it.

Check your code for any time-based conditions:

// This restricts trading to a narrow window
If Time >= 0930 and Time <= 1030 then begin
    // Trading logic here
end;

Remember that TradeStation uses the exchange's local time by default. If you're in a different timezone, your time filters may not work as expected.

To debug, temporarily remove or comment out all time filters and see if signals appear:

// Temporarily disabled for testing
// If Time >= 0930 and Time <= 1030 then begin
    // Trading logic now runs anytime
// end;

Also check for day-of-week filters. You might have accidentally excluded the days you're testing:

// This excludes Monday (1) and Friday (5)
If DayOfWeek(Date) <> 1 and DayOfWeek(Date) <> 5 then begin
    // Your strategy might be missing 40% of trading days
end;

7. Your Conditions Are Never True

Sometimes the logic is syntactically correct but mathematically impossible. This is especially common with multiple conditions combined using and:

// This condition can NEVER be true
If RSI(Close, 14) > 70 and RSI(Close, 14) < 30 then
    Buy next bar at market;

Obviously, RSI can't be both above 70 and below 30 simultaneously.

A more subtle version happens with tight thresholds:

// These conditions are rarely both true on the same bar
If Close > Open and Close < Open + 0.01 then
    Buy next bar at market;

Debug by printing your condition values to the message log:

Print("Bar: ", CurrentBar,
      " RSI: ", RSI(Close, 14),
      " MACD: ", MACD(Close, 12, 26));

Open the Message Log window (View > Message Log) to see these values as each bar processes. This tells you exactly what your indicators are calculating and why conditions aren't triggering.

8. Strategy Properties Are Misconfigured

TradeStation's strategy properties control position sizing, commission, and other critical settings. Wrong values here can prevent trades entirely.

Right-click your chart, select Format Strategies, click your strategy, then click Properties.

Check these settings in particular.

Under "Costs," verify that commissions and slippage aren't set absurdly high. I've seen traders accidentally enter $100 per trade instead of $1, making the strategy unprofitable by design.

Under "Position Sizing," make sure you're trading at least 1 contract or share. A setting of 0 means no trades will execute.

Under "Backtest Properties," check that your starting capital is sufficient for the position sizes you're requesting. If you're trying to trade 10 ES contracts with $10,000 starting capital, TradeStation may reject trades due to insufficient margin.

9. The Code Doesn't Compile

If there are syntax errors in your code, TradeStation won't execute the strategy, but the error messages can be cryptic.

After modifying your code, always verify it compiles successfully. In the EasyLanguage Development Environment, press F3 to verify the code. Any errors will appear in the output panel at the bottom.

Common compilation errors include:

Missing semicolons at the end of statements. Every statement in EasyLanguage must end with a semicolon.

Undeclared variables. Every variable must be declared in a Variables: section before use:

Variables:
    MyVariable(0),    // Numeric, initialized to 0
    MyString(""),     // String, initialized to empty
    MyBool(false);    // Boolean, initialized to false

Misspelled keywords. EasyLanguage is case-insensitive, but built-in function names must be spelled correctly. Averge won't work, but Average will.

After verifying, close and reopen your chart to ensure the latest compiled version loads.

A Systematic Debugging Approach

When your strategy fails, work through these steps in order:

Start by checking the basics: automation on, strategy enabled, sufficient data loaded.

Next, verify the code compiles without errors by pressing F3 in the development environment.

Then, add Print statements to trace execution and see what values your indicators are calculating.

After that, simplify by commenting out all conditions except one and test if that single condition ever becomes true.

Finally, check the Message Log and Trade Activity Log for error messages or rejected orders.

This systematic approach finds 95% of issues within 15 minutes.

Still Stuck?

Strategy debugging is a skill that improves with practice. The more strategies you build and troubleshoot, the faster you'll spot problems.

If you're building your own strategies from scratch, consider starting with proven templates that you know work correctly. That way, you can focus on customizing the logic rather than debugging basic syntax issues.

At QuantCodeClub, we publish working EasyLanguage strategies with transparent performance data, so you can see exactly how professional-grade code is structured. It's free to browse the library and see what properly formatted strategies look like.

Whatever path you choose, remember: every experienced trader has spent hours debugging broken strategies. It's part of the learning process. Keep at it.

Want More Trading Strategies?

Join our waitlist to receive 12 OOS-tested EasyLanguage strategies per year, complete with source code and backtesting reports.

Join the Waitlist - It's Free