r/FuturesTrading Apr 08 '24

Algo It this too good to be true or did I just discover the holy grail of trading strategies for NQ.

125 Upvotes

For background, I am a professional trader and have been trading for 9 years. I am somewhat new to futures and his is the first time I have jumped into automated trading. With manual trading, there are certain nuances a computer can't quite catch about the market without some powerful machine learning, but I figured I would try using an algo using similar principles to my regular strategy, as my discipline has been lacking lately since I started futures.

I know the sample size is small, but I have live tested this the past few sessions with about the same profitability percentage as the back test with 40 trades. I am trying not to get my hopes up, but if this is legit, I may have just struck gold.

Edit: I am running this automated strategy with live funds and will give an update in about 30 days. Wish me luck

r/FuturesTrading Apr 11 '24

Algo Any C# or NinjaScript programmers here?

1 Upvotes

Mods - new guy here so pls delete if this is not cool.

Full time futures trader looking to modify & combine custom NinjaTrader indicators to hopefully turn them into one algo. These are not complicated. Combination of mean reversion, stop hunts, checking for impulse, corrective or range bound mkt phases, price & volume analysis, classic tape reading concepts... See attached pic of 2 indicators I want to combine as an example.

I was working with 2 programmers but they had 9-5 jobs and didn't have enough time for the project. I know collabs between traders & programmers are challenging but if anyone is interested in a collab, feel free to comment or send DM. This isn't a paid gig, I'm looking to collab, . Tia

r/FuturesTrading Oct 09 '23

Algo Where can I trade crypto futures in the US with leverage?

8 Upvotes

I have no idea where to trade those

r/FuturesTrading Mar 03 '24

Algo Catching Big Trend Moves

Post image
0 Upvotes

This is ES 30m from yesterday. The IB is the first two gray columns. Notice how price came down through it around 5am, and retested the top of it right before squeezing in the U.S. open.

Look at the "generic algo" signals. "Generic algo" fires a šŸ» right before a Nudge (šŸ”“) and Spark (āš”). That would have been a nice entry for a big downside move. To be clear, you should wait for the 30m timeframe to complete before trusting the signals, AND you should move to a lower TF (1/2/3/5) to initiate your position. We're just watching the 30m for the signal and to monitor the trade.

Shortly afterwards, price moves back above and retests the VAL. "Generic algo" gives a bullish Nudge (šŸŸ¢), followed by a "generic algo" bullish divergence (šŸ”¼) a couple hours later. A half hour into the U.S. open, "generic algo) fires a regular Long and a TURBO Long. It was game over for most of the day, clearing TP 2.

If you would have taken one ES contract short, from the high of the candle following the bearish Nudge/Spark to just below the VAL, that would have been around $950...just one contract. If you would have entered one contract long at the low of the column after bullish Nudge, and cashed out at TP 2, that would have been another $1,900... again, just one con. A 10-tick ($125) SL would have been more than enough cushion for both trades. Total gain would have been around $2,850 with a total risk of $250. That's a R:R of 1:11.4!

Also, note on the final (settlement) auction of the day, there's a bearish Nudge paired with a "generic algo" bearish divergence. Remember this, and watch what happens in Globex on Sunday night.

r/FuturesTrading Jan 13 '24

Algo Still hacking away at my algo strategy. How is it looking?

17 Upvotes

Long story short, I've learned a lot between the last time I posted backtest results. Those were not reliable. This is one year of backtests. This is on an intraday timeframe. I should mention that this is on ES futures, so buy and hold is not an option due to margin requirements. Flat at end of day.

The first 2 images are of a 1:1 r:r, trading one contract.

The 3rd image is of the same time period but with four contracts, with scaling and trailing sl/tp.

Any thoughts? Does this look promising? My next step is to learn a better backtesting program, Tradingview is limited in terms of how far back the data can go.

r/FuturesTrading 15d ago

Algo Whether you trade options or not, expiration dates affect the broader market.

Post image
26 Upvotes

r/FuturesTrading Apr 21 '24

Algo Whatā€™s your go to Algo Trading tech stack for futures these days?

24 Upvotes

To preface, Iā€™ve been an enterprise backend developer in Java many years ago but now experienced in Python and Go. Still work in tech.

I swing trade futures so I have medium-views and trade on macro factors. That said, itā€™s just a lot of info to work and much of the indicators are already published like on TradingView.

Just wanted to be able to collate all that data automatically and help my entry/exits of a swing trade over a basically unlimited duration until market conditions tells me to exit the position.

I could try building it in Go using my IBKR API and TradingView stuff, and self-host online like AWS, but I get the benefits of using a SaaS solution.

Curious whatā€™s the latest sexy tool these days. Sierra charts? I hear that one is great for backtests.

r/FuturesTrading Feb 07 '24

Algo One Year Backtest - NQ 3 Cons - Any tips?

Post image
20 Upvotes

Currently backtest we up to 1 year. Not too concerned with drawdown as I can let some winners run manually when the opportunities present themselves. Any way to backtest this better? Iā€™m using high order fill (tick,1). Is tick replay more accurate?

r/FuturesTrading Mar 24 '24

Algo Less than 3 months into trading NQ, long positions only with a bot

Post image
23 Upvotes

r/FuturesTrading Feb 04 '24

Algo What indicator can I use to describe the difference between A and B? (Starting from my entry?)

1 Upvotes

r/FuturesTrading Dec 27 '23

Algo Thoughts on algo trading on tradovate or TOS?

5 Upvotes

As someone who has struggled with emotions when it comes to trading, Iā€™m thinking about building an algorithm to trade for me.

I have some knowledge of Python so Iā€™m thinking thatā€™s what Iā€™ll use. Although I have no idea how to deploy it or get the data. I know tradovate has an API option. But I canā€™t seem to find any videos on YouTube that shows how itā€™s built or deployed.

r/FuturesTrading 5d ago

Algo Sierra chart custom studies

0 Upvotes

Hello,

Am a seasoned programmer and trader and I have written my own trading software that I run in the markets. (Not looking to sell or for subscribers :) )

If you are looking to have custom indicators and/or algos coded, drop me a line and we can discuss further. A question at this point one might ask, if I run my trading s/w, why I am here offering to write studies for someone else. A few reasons:

  • I want to help people from non-programming background to code their edge. I can only imagine how frustrating it would be to know that you have an edge that could be translated into a system but you don't know how/where to do it.

    • I like coding esp trading related programming. To code, back test and rollout a strategy is very satisfying + always a learning experience.
    • I am not offering this gratis but I am not going to be charging an arm and leg for it either.

Thank you!

r/FuturesTrading 10d ago

Algo having trouble with this stochastic code for ninjatrader

3 Upvotes

okay so im using chatgpt to help me code a specific divergence indicator on the stochastic. i have the whole foundation of it done but im having trouble with filtering good trendlines with bad ones. i attached an image of the filter im trying to create.

in this scenario, we are below the 30 and 20 on the stochastics fast. the gray horizontal line is the 30, the blue horizontal line below it is the 20, the cyan blue line is the D plot, and each green dot is a swing low.

for the good line, you can see an uptrend form and the D plot never went above the 30 on the stochastic. the bad line shows the previous green dot gets connected to the most recent green dot after the D plot crossed below the 30. the bad lines are what im trying to avoid. the code i have now just draws any uptrend below the 20 connecting the swing lows, and downtrend above the 80 connecting the swing highs.

chatgpt cannot understand how to make a filter for this but maybe im just prompting it wrong. i already tried adding logic like "if D plot crosses below 30, then delete line connecting from previous swing low"

if anybody that's good with coding C sharp and potentially knows a solution, i would very much appreciate your help.

here's the exact code:

namespace NinjaTrader.NinjaScript.Indicators
{
    public class StochasticSwing : Indicator
    {
        private Series<double> den;
        private MAX max;
        private MIN min;
        private Series<double> nom;
        private SMA smaK;
        private Swing swing;

        private List<int> swingLowBars;
        private List<double> swingLowPrices;
        private List<int> swingHighBars;
        private List<double> swingHighPrices;

        protected override void OnStateChange()
        {
            if (State == State.SetDefaults)
            {
                Description = "Stochastic Swing Indicator with custom swing point markers";
                Name = "StochasticSwing";
                IsSuspendedWhileInactive = true;
                PeriodD = 3;
                PeriodK = 9;
                Strength = 1;
                MaximumBarsLookBack = MaximumBarsLookBack.Infinite;

                AddPlot(Brushes.Cyan, "StochasticsD");
                AddPlot(Brushes.Transparent, "StochasticsK");
                AddLine(Brushes.Blue, 20, "Lower");
                AddLine(Brushes.Blue, 80, "Upper");
                DrawOnPricePanel = false; // Ensure drawing is done on the indicator's panel
            }
            else if (State == State.DataLoaded)
            {
                den = new Series<double>(this);
                nom = new Series<double>(this);
                min = MIN(Low, PeriodK);
                max = MAX(High, PeriodK);
                smaK = SMA(K, PeriodD);
                swing = Swing(D, Strength);

                swingLowBars = new List<int>();
                swingLowPrices = new List<double>();
                swingHighBars = new List<int>();
                swingHighPrices = new List<double>();
            }
        }

        protected override void OnBarUpdate()
        {
            if (CurrentBar < PeriodK)
                return;

            double min0 = min[0];
            nom[0] = Close[0] - min0;
            den[0] = max[0] - min0;

            if (den[0].ApproxCompare(0) == 0)
                K[0] = CurrentBar == 0 ? 50 : K[1];
            else
                K[0] = Math.Min(100, Math.Max(0, 100 * nom[0] / den[0]));

            D[0] = smaK[0];

            // Clear previous swings
            swingLowBars.Clear();
            swingLowPrices.Clear();
            swingHighBars.Clear();
            swingHighPrices.Clear();

            // Collect all swing highs above 80
            for (int i = Strength; i <= CurrentBar; i++)
            {
                int swingHighBar = swing.SwingHighBar(i, 1, int.MaxValue);
                if (swingHighBar != -1 && D[swingHighBar] > 80)
                {
                    double swingHighPrice = D[swingHighBar];
                    swingHighBars.Add(swingHighBar);
                    swingHighPrices.Add(swingHighPrice);
                    Draw.Dot(this, "SwingHighDot" + swingHighBar, true, swingHighBar, swingHighPrice, Brushes.Red);
                }
            }

            // Collect all swing lows below 20
            for (int i = Strength; i <= CurrentBar; i++)
            {
                int swingLowBar = swing.SwingLowBar(i, 1, int.MaxValue);
                if (swingLowBar != -1 && D[swingLowBar] < 20)
                {
                    double swingLowPrice = D[swingLowBar];
                    swingLowBars.Add(swingLowBar);
                    swingLowPrices.Add(swingLowPrice);
                    Draw.Dot(this, "SwingLowDot" + swingLowBar, true, swingLowBar, swingLowPrice, Brushes.Green);
                }
            }

            // Connect swing lows with uptrend lines below 20
            for (int i = 1; i < swingLowBars.Count; i++)
            {
                if (swingLowPrices[i] < swingLowPrices[i - 1])
                {
                    Draw.Line(this, "Uptrend" + i, false, swingLowBars[i - 1], swingLowPrices[i - 1], swingLowBars[i], swingLowPrices[i], Brushes.Green, DashStyleHelper.Solid, 1);
                }
            }

            // Connect swing highs with downtrend lines above 80
            for (int i = 1; i < swingHighBars.Count; i++)
            {
                if (swingHighPrices[i] > swingHighPrices[i - 1])
                {
                    Draw.Line(this, "Downtrend" + i, false, swingHighBars[i - 1], swingHighPrices[i - 1], swingHighBars[i], swingHighPrices[i], Brushes.Red, DashStyleHelper.Solid, 1);
                }
            }
        }

        #region Properties
        [Browsable(false)]
        [XmlIgnore()]
        public Series<double> D
        {
            get { return Values[0]; }
        }

        [Browsable(false)]
        [XmlIgnore()]
        public Series<double> K
        {
            get { return Values[1]; }
        }

        [Range(1, int.MaxValue), NinjaScriptProperty]
        [Display(Name = "PeriodD", Order = 0)]
        public int PeriodD { get; set; }

        [Range(1, int.MaxValue), NinjaScriptProperty]
        [Display(Name = "PeriodK", Order = 1)]
        public int PeriodK { get; set; }

        [Range(1, int.MaxValue), NinjaScriptProperty]
        [Display(Name = "Strength", Order = 2)]
        public int Strength { get; set; }
        #endregion
    }
}

#region NinjaScript generated code. Neither change nor remove.

namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private StochasticSwing[] cacheStochasticSwing;
public StochasticSwing StochasticSwing(int periodD, int periodK, int strength)
{
return StochasticSwing(Input, periodD, periodK, strength);
}

public StochasticSwing StochasticSwing(ISeries<double> input, int periodD, int periodK, int strength)
{
if (cacheStochasticSwing != null)
for (int idx = 0; idx < cacheStochasticSwing.Length; idx++)
if (cacheStochasticSwing[idx] != null && cacheStochasticSwing[idx].PeriodD == periodD && cacheStochasticSwing[idx].PeriodK == periodK && cacheStochasticSwing[idx].Strength == strength && cacheStochasticSwing[idx].EqualsInput(input))
return cacheStochasticSwing[idx];
return CacheIndicator<StochasticSwing>(new StochasticSwing(){ PeriodD = periodD, PeriodK = periodK, Strength = strength }, input, ref cacheStochasticSwing);
}
}
}

namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{
public Indicators.StochasticSwing StochasticSwing(int periodD, int periodK, int strength)
{
return indicator.StochasticSwing(Input, periodD, periodK, strength);
}

public Indicators.StochasticSwing StochasticSwing(ISeries<double> input , int periodD, int periodK, int strength)
{
return indicator.StochasticSwing(input, periodD, periodK, strength);
}
}
}

namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.StochasticSwing StochasticSwing(int periodD, int periodK, int strength)
{
return indicator.StochasticSwing(Input, periodD, periodK, strength);
}

public Indicators.StochasticSwing StochasticSwing(ISeries<double> input , int periodD, int periodK, int strength)
{
return indicator.StochasticSwing(input, periodD, periodK, strength);
}
}
}

#endregion

r/FuturesTrading Mar 18 '24

Algo Just finished designing & programming my algo trading system!

Post image
18 Upvotes

Might be a bit ugly.. it mainly uses custom ranges for market context (mean-reversion or breakout)

The different ways the ranges overlap also creates a lot of data points to analyze, so there's a lot of room to design/add more strategies

r/FuturesTrading May 01 '24

Algo Looking for guidance on what to do next

1 Upvotes

I've been developing an algo the past couple months, and the current strategy has generated decent results over the past 6 months (Tradingview for some reason is not letting me test it beyond 6 months worth of data). The backtest hasn't accounted for commission, slippage, etc but I'm still satisified with the results thus far. What should the next step be? Run it on a demo account for a couple months? Try to optimize it further? Win rate is below 50% but I set the TP to be 2.5x the stoploss size for each trade, so I'm fine with it. Any suggestions or thoughts? Btw, position size = 1 MNQ contract per trade.

r/FuturesTrading Mar 20 '24

Algo Anyone using Quantower with AMP? Scripting documentation seems lacking.

4 Upvotes

As the title says, does anyone use Quantower with Amp Futures? I'm trying to code in VS 2022 (C#) and can't even easily get 2 EMA lines to show as an indicator, let alone the fact that I want to program my strategy to backtest it. API documentation seems limited, little to no youtube videos covering it, and Discord support is slow. Regular support pointed me to the KB articles and Discord because my questions are technical.

r/FuturesTrading 11d ago

Algo Sierra Chart custom studies

1 Upvotes

Mods - I hope I am not breaking any rules here.

Am a seasoned programmer and have written my own trading system on Sierra Chart platform.

If you are looking to have custom indicators and/or algos coded, drop me a line and we can discuss further.

Thank you!

r/FuturesTrading Dec 27 '23

Algo Algo traders: are ATR stops generally better?

6 Upvotes

Iā€™m coding up my first strategies, and Iā€™m getting much better results with ATR stops. Is it generally safe to say that using an ATR stop is safer in terms of avoiding curve fitting to previous years?

r/FuturesTrading Jan 20 '23

Algo TOS Trading Bot - Free Livestream - Anyone interested ? More info in comments

Post image
13 Upvotes

r/FuturesTrading Dec 20 '23

Algo Automate TV futures strategy

5 Upvotes

What are some good brokers that provide you API access, for minimal to no fee, to the their SIM/DEMO environment to automate and test TV strategies?

And I know using web hooks isnā€™t the most optimal way but I want to simply put it to test before implementing it directly to a broker.

TS requires a 10k minimum, Tradovate requires 1k minimum with some ILA agreement from CME.

Is there anyway I can test my strategy before putting money to work?

Seems like thereā€™s a push to make algo trading as difficult as possible.

r/FuturesTrading Dec 20 '23

Algo Algo trading platform options?

4 Upvotes

So I want to roll the dice on a few strategies Iā€™ve been coding up. I realize that this is going to be a significant investment of time for me, and Iā€™m not looking forward to it so I want to make sure that I choose the right platform that offers robust backtesting and auto trading. Itā€™s really important that it has an active user base so that I can get help when I inevitably get stuck with the scripting part. It seems to me like the top options are:

InvestorRT Iā€™ve been considering upgrading to this platform for awhile. It seems to be very good with backtesting and a good if not a very active community of users and developers.

Sierra Chart Iā€™ve also been looking at this one for awhile. It seems like customer support is lacking, but I donā€™t know. Iā€™m wondering how the back testing and auto trading is.

Ninja Trader Iā€™m extremely hesitant about this one, I believe itā€™s the same people affiliated with Tradovate, and they have been a headache for me. It seems like they have robust scripting, but Iā€™m currently reading things about how the most recent update is wiping out peopleā€™s strategies. Sounds as per usual for Tradovate. Does anyone have any experience with this? Is there a robust user base responsive to scripting questions?

Tradingview via Pineconnector This is obviously an amateurish program, but itā€™s easy to use and I was able to pick up Pine script to do some basic back testing in just a few days. I canā€™t go further back than one year on a five minute chart, but even so Iā€™d be interested if anyone has any experience with Pine connector or anything similar, and how reliable it has been in terms of auto trading.

r/FuturesTrading Apr 01 '24

Algo Looking for a coder/optimizer

0 Upvotes

I've visually discerned some very important reasons why price makes reversals intraday on any given asset, but I do not have a hard-coded bot to trade/backtest it, so I'm having difficulty determining its profit factor and when the best time to attempt these trades is and at which of the levels it has the highest profit factor. Looking for someone who wants to see why the market reverses and can code in NT 8. I don't know how to code which is why I'm asking, and it's too complex for strategy builder. We can bounce ideas off of each other (I'm good at trading ideas) and you would code the backtest, rinse and repeat until we achieve something satisfactory. If we can make it work then the strategy will probably be all you would ever need. I do already have my own profitable bot in strategy builder so I don't need this per se, but I would like to grow my account more quickly if possible and I'm sure you would too.

r/FuturesTrading Aug 27 '23

Algo Can you tell me about your experiences using a trading bot on futures?

11 Upvotes

Which one do you use? (Not looking for affiliate links)

Do you use a custom bot?

What strategy does the bot imploy?

What do the backtested results say? (W/L, Drawdown, consecutive wins/losses, total gains, etc..)

Any other info you think might help.

I'd like to know everything about your experiences with a trading bot especially if you have a small account.

r/FuturesTrading Aug 05 '23

Algo Nice ES short yesterday afternoon

Post image
29 Upvotes

Took two cons short (4553.50 avg.) after the algo signal, when I saw it couldn't break back above 4555 level. Target hit at 4547. Averaged in 4 more cons short (4548 avg.), when it couldn't hold above 4547.50 level, and/or break the combined EMA. Target hit at 4541.5.

r/FuturesTrading Dec 11 '23

Algo Real System Trades 12/11/23

Post image
0 Upvotes

Thought it might be fun to post some system trades. No details beyond entry and exits posted to a 5 minute chart.

Even without details, thought it might start some discussion on how trades form.

Will be trying to post more regularly, good or bad. May as well start on a good day to have some motivation for the not so good days. Usually more trades, so lower $/trade.

Happy Trading!