shorttrader Posted Sunday at 01:25 PM Report Posted Sunday at 01:25 PM (edited) I am sharing Delta Auto Trader here but need to be fixed because sometimes there is no entry. Please help me to fix the code… its based on amount of negative and positive price levels in a row and bar close. https://www.sendspace.com/file/pkdmwf Edited Sunday at 01:26 PM by shorttrader ⭐ goldeneagle1, alodante, ⭐ osijek1289 and 1 other 2 2
shorttrader Posted 17 hours ago Author Report Posted 17 hours ago Is there no one here who is an NT programmer?
orfila Posted 11 hours ago Report Posted 11 hours ago Might I ask you, why are you doing a strategy as an indicator? Would it not be easier to make an indicator and call it from a strategy?
orfila Posted 5 hours ago Report Posted 5 hours ago (edited) From Grok:: Based on the provided code for the FootprintAutoTrader indicator (which appears to be a custom or hybrid implementation, potentially based on or similar to third-party tools like TradeDevils' Auto Orderflow Trader strategy), I'll outline the likely reasons why it may not be taking enough trades. My analysis draws from the code structure, parameters, and common NinjaTrader issues identified through research. Note that the code is truncated, so I can't see the full trading logic (e.g., exact conditions in OnBarUpdate or OnMarketData), but it involves building footprint data (bid/ask volumes, deltas) and using thresholds to trigger trades. This indicator submits orders (unmanaged mode, as indicators can do this in NinjaTrader, though it's unconventional—strategies are preferred for automation). ### Key Code Insights Relevant to Trade Frequency - **Parameters Controlling Entries**: Many thresholds like `maxNegL`, `minNegL`, `maxPosL`, `minPosL`, `minNegRow`, `maxPosS`, `minPosS`, `maxNegS`, `minNegS`, `minPosRow` appear to define minimum/maximum positive/negative delta values or row counts for long/short signals (e.g., imbalances, delta flips). If set too high (e.g., requiring extreme deltas or multiple rows of negativity), signals will rarely trigger. - **Order Type (`oT`)**: Supports Market or Limit orders. Limit orders (with `stopLimitOffset`) may not fill if price doesn't hit the limit, reducing trade execution. - **Account Handling**: `Account a=null;` then likely sets `a` based on `account_list`. If the account name doesn't match or isn't connected, no trades. - **Flags and States**: `ab=true;` (possibly an "armed" or enable flag). If toggled off, no trades. - **Data Building**: Uses `OnMarketData` (implied) to populate bid/ask dictionaries (`_dctAsk`, `_dctBid`, `_dctDelta`) and bar deltas (`currDelta`). Trades likely trigger on delta imbalances or patterns (e.g., stacked negatives/positives). - **Risk/TP/SL**: Parameters like `tP`, `sL`, `tP2`, `sL2`, `q1`, `q12`, `tP21`, `q2`, `stopOffset` control position sizing and exits. If SL is too wide or quantity (`q1`, etc.) is zero, it may skip entries. - **General Logic**: Builds per-bar deltas and historical dictionary (`dctMain`). Entries probably check if current bar's delta meets thresholds (e.g., negative delta > minNegL for longs). Few trades if market conditions rarely match. ### Common Reasons for Not Taking Enough Trades Here are the most probable causes, prioritized by likelihood based on the code and NinjaTrader ecosystem research (e.g., forum discussions on strategies not entering, data issues, and order flow tools): 1. **Strict Entry Conditions/Parameters**: - Thresholds (e.g., `minNegRow` for minimum negative rows in footprint) may require rare events like 3+ stacked imbalances or high delta surges. Default settings in similar tools (e.g., 3 for stacked imbalances) often result in infrequent signals if the market is ranging or low-volatility. - Solution: Lower thresholds (e.g., minNegL to smaller values) or test in Strategy Analyzer to see signal frequency. If using combined logic (e.g., multiple signals needed), simplify to single-signal triggers. 2. **Strategy/Indicator Not Enabled or Paused**: - In NinjaTrader, strategies/indicators must be explicitly enabled (e.g., via chart toolbar or right-click > Strategies). If the name shows orange, it's waiting for a flat position before trading. - Code flag like `ab=true` might control this; if false, no entries. - Similar tools have "pause/run" or "one-shot" modes (one trade then pause). Check if armed in continuous mode. - Solution: Ensure enabled in chart, and check for any on-chart panel (code suggests a control panel) to arm/resume. 3. **Account or Connection Issues**: - If `account_list` doesn't match an available account (code uses `Account.All`), `a` remains null, preventing order submission. - Must be connected to a live/sim account with futures data enabled. Simulation mode may limit trades if not flat first. - Solution: Verify account name in parameters matches (use sim101 for testing). Reconnect via Control Center. 4. **Data Feed or Resolution Problems**: - Footprint logic relies on tick-level bid/ask data (via OnMarketData). Without real-time Level II data or tick replay enabled, deltas won't calculate accurately, leading to no signals. - Requires unfiltered tick data; if using minute bars or filtered feed, incomplete footprints. - NinjaTrader's Order Flow+ (for built-in footprints) needs a Lifetime license or subscription; third-party like this may bypass but still need proper data. - Backtest vs. live discrepancies common if not using high-fill resolution or tick replay. - Solution: Enable Tick Replay in Data Series, use a provider like Kinetick or your broker for unfiltered ticks. Test on replay data to confirm signals fire. 5. **Filters Blocking Trades**: - Implied filters for volume/delta % (common in footprint autos). If min volume/delta too high, trades skipped. - Session/day-of-week/daily loss/drawdown limits (if implemented) may halt trading early. - Ranging vs. trending mode (in similar tools) inverts signals, potentially reducing frequency in choppy markets. - Solution: Disable or loosen filters in parameters. Check logs (TraceOrders=true) for skipped reasons. 6. **Order Type and Filling Issues**: - If `oT=Limit`, orders may not fill if price doesn't reach the limit (+ `stopLimitOffset`). - Market orders fill reliably but may slip in volatile conditions. - Solution: Switch to Market orders for testing. 7. **Position Sizing or Risk Management**: - If quantity (`q1`, `q2`) is 0 or calculated risk exceeds account balance (e.g., SL too large), skips entries. - Multi-target scaling (`tP2`, etc.) might interfere if positions not managed properly. - Solution: Set fixed small quantities (e.g., q1=1) and tight SL for testing. 8. **Code or Platform Bugs**: - Truncated code suggests possible incomplete logic (e.g., null checks missing, leading to exceptions). - Historical issues in similar tools: Wrong direction trades, immediate opens on enable (fixed in updates). - NinjaTrader performance: Too many indicators or large historical data slows processing, missing signals. - Solution: Check NinjaTrader logs (Help > Mail to Support) for errors. Update to latest version. If third-party, check for updates (e.g., v2.0.0.11 fixed exceptions). ### Recommendations to Troubleshoot and Increase Trades - **Test in Replay/Backtest**: Use Strategy Analyzer with high-fill resolution and tick data to count signals/trades. Adjust parameters iteratively. - **Enable Logging**: Set `TraceOrders = true;` (add if not in code) to log why entries are skipped. - **Simplify Setup**: Start with loose thresholds (e.g., minNegL=100, minPosRow=1), Market orders, sim account, and no filters. Add complexity once trades fire. - **Verify Data**: Load a chart with your footprint indicator; ensure deltas/imbalances show as expected. - **Community/Resources**: Search NinjaTrader forums for "order flow strategy not entering" or contact the vendor (if TradeDevils or similar) for support. Common fixes involve enabling Tick Replay and proper account setup. - **Code Tweaks**: If custom, add print statements (e.g., `Print("Signal check: delta=" + currDelta);`) to debug conditions. If you provide more details (e.g., parameter values, error logs, or the full code), I can refine this further. This should help diagnose and fix the issue! Edited 5 hours ago by orfila
shorttrader Posted 4 hours ago Author Report Posted 4 hours ago Forget Ai to do that. If you are not c# expert you can not fix the issue.
kimsam Posted 3 hours ago Report Posted 3 hours ago On 8/31/2025 at 4:25 PM, shorttrader said: I am sharing Delta Auto Trader here but need to be fixed because sometimes there is no entry. Please help me to fix the code… its based on amount of negative and positive price levels in a row and bar close. https://www.sendspace.com/file/pkdmwf check this .. FootprintAutoTrader.cs orfila 1
kimsam Posted 3 hours ago Report Posted 3 hours ago (edited) need more fixes ... * tick data needed Edited 3 hours ago by kimsam shorttrader 1
kimsam Posted 2 hours ago Report Posted 2 hours ago here the strategy .. FootprintDeltaStrategy.cs shorttrader, alodante and orfila 3
shorttrader Posted 2 hours ago Author Report Posted 2 hours ago (edited) Thanks @kimsam for your support. Have you fixed now? Strategy 1 and strategy 2 criteria means in the current bar it is allowing x positive levels or negative levels no matter where in the bar.And strategy 3 means criteria must be from the bottom or from the top of bar depended long or short Edited 2 hours ago by shorttrader
kimsam Posted 2 hours ago Report Posted 2 hours ago (edited) here update .. more filters added .. FootprintDeltaStrategy.cs Edited 2 hours ago by kimsam ⭐ osijek1289 and alodante 1 1
kimsam Posted 2 hours ago Report Posted 2 hours ago 21 minutes ago, shorttrader said: Thanks @kimsam for your support. Have you fixed now? Strategy 1 and strategy 2 criteria means in the current bar it is allowing x positive levels or negative levels no matter where in the bar.And strategy 3 means criteria must be from the bottom or from the top of bar depended long or short check the new update
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now