Gold futures trading strategy | Code exposed!

  Рет қаралды 4,566

StatOasis

StatOasis

Күн бұрын

Central bank policy of printing and flooding the system with cash is working for some people but it is driving inflation up. The Gold market is one of the oldest safe haven for cash in high inflation regimes. it has been performing well this year. In this video I will build a strategy that will beat Gold buy and hold.
How to use ADX filter: • ADX Indicator BEST Set...
⇣ J O I N A L G O M A S T E R C L A S S C O M M U N I T Y ⇣
👉 Join Algo Trading Master Class |
👉 Discord Community | go.statoasis.com/Discord
⇣ D I S C O U N T C O D E S ⇣
Thank you for using them to support my channel! It allows me to create awesome videos at no cost to you.
⇢ statoasis.com/offers
⇣ F R E E S Q X I N D I C A T O R S & E B O O K S ⇣
🔥 Grab your FREE ebook & Multibar Pattern Generator for SQX:
go.statoasis.com/MBar
🔥 Grab your FREE ebook & candlestick patterns SQX Custom Blocks: go.statoasis.com/CSebook
🔥 Grab your FREE Excel Database to filter +20,000 tickers from SQX data packages:
go.statoasis.com/db
🕞 Index 🕥
----------------------
00:00 Introduction
02:09 Gold Performance
03:33 Basic Breakout Strategy
05:40 Adding a filter to the basic strategy
07:22 Strategy Optimization Performance Report
09:24 Running a Monte Carlo test on the breakout strategy
10:35 Building a portfolio on several futures markets using the same strategy
11:52 Final thoughts...
Let's Connect:
---------------------------------------------------------------------
▶️ Subscribe to my KZfaq channel | go.statoasis.com/yt
📲 Check out my website | www.StatOasis.com
✍ Read my blog | go.statoasis.com/blog
🐦Twitter | go.statoasis.com/twitter
📸 Instagram | go.statoasis.com/instagram
👍 Discord | go.statoasis.com/Discord
_____________________________________________________________________
DISCLAIMER: None of what I talk about to be construed as investment advice, I am not a financial adviser nor a CPA. The videos are for educational and entertainment purposes only. The information presented in the video is accurate as of the posting date of the video and might not be accurate in the future. All links in the description might have some affiliate links and I may receive a small commission. I only share the tools and resources that I love and use regularly. Thank you so much for your support! 😍
#Finance #Investing #AlgoTrading
Ali Casey here from StatOasis channel, I post about Finance, Investing, Algorithmic Trading and everything else in between.
I strive to provide the best education on the subjects mentioned above, the goal is take control of your financial future. If you like what you read, then subscribe and if you're still reading this, you rock! thank you ❤️

Пікірлер: 86
@5.56mm
@5.56mm 2 жыл бұрын
Thank you so much for this one, Ali! I really appreciate that you show the code so we can learn more and maybe build something new out of what you're showing us. Keep this kind of content coming please. 🙂
@StatOasis
@StatOasis 2 жыл бұрын
Thank you for your kind words
@Yewbzee
@Yewbzee 2 жыл бұрын
Cheers Ali, thanks for sharing.
@StatOasis
@StatOasis 2 жыл бұрын
Thank you for watching
@rod85y
@rod85y 2 жыл бұрын
Absolutely brilliant!
@StatOasis
@StatOasis 2 жыл бұрын
That’s so nice of you
@Ricky-sx5el
@Ricky-sx5el 2 жыл бұрын
That cup and handle wodoo science part was really funny. :D
@StatOasis
@StatOasis 2 жыл бұрын
😀 technical analysis is filled with them
@theauxnguyen150
@theauxnguyen150 2 жыл бұрын
Simple but effective strategy! Thank Ali 🙏
@StatOasis
@StatOasis 2 жыл бұрын
Thank you for watching
@theauxnguyen150
@theauxnguyen150 2 жыл бұрын
@@StatOasis I learn from every video of you. You are like my mentor 🤝
@StatOasis
@StatOasis 2 жыл бұрын
Glad to be of help
@DrMrsChaves
@DrMrsChaves 2 жыл бұрын
Did you do a video on how you determine market characteristics? That would be very interesting! I'm referring to "Futures Edges" at 3:02.
@StatOasis
@StatOasis 2 жыл бұрын
that is part of my Algo Trading Masterclass, buy you can use ADX to compare markets relative to each other
@drorshapira1825
@drorshapira1825 2 жыл бұрын
Although the idea behind breakouts is very common, it is great you gave a list of some futures that works best with the concept! BUT, if you check theses strategies with inside bar look up, you realize they are not usable in real-time. Please make an update video with the correct way to use it .. :)
@StatOasis
@StatOasis 2 жыл бұрын
Please check Natural Gas portfolio video, same concepts with wider distance between SL & PT Although I did test this using 1m look inside bar
@ericwilber1228
@ericwilber1228 2 жыл бұрын
another good one!
@StatOasis
@StatOasis 2 жыл бұрын
Thank you! Cheers!
@covingtoncreek
@covingtoncreek 2 жыл бұрын
I really respect you and like your channel. I will say, in this specific video, with 36k iterations and no out of sample, I'm sure your results are curve fit, at least to some significant extent. I do appreciate your great content, though, as always.
@StatOasis
@StatOasis 2 жыл бұрын
Thank you, of course there is a big probability of over fit, any strategy has to go through robustness testing before committing any capital to it
@Yewbzee
@Yewbzee 2 жыл бұрын
Additional market testing of the same strategy is one of the best robustness tests you can use which the strategy looked like it passed quite well here.
@5.56mm
@5.56mm Жыл бұрын
Just do a "look inside bar" test on this one, and it quickly falls apart. With that said, there are other ways to modify this "core" of a strategy to make it more robust.
@covingtoncreek
@covingtoncreek Жыл бұрын
@@5.56mm Great insight there. So many don't think to use LIBB when backtesting, and it can make a huge difference.
@5.56mm
@5.56mm Жыл бұрын
@@covingtoncreek Yup, and it must be said before people go losing money by trading it live. 🙂
@majidghorabi1864
@majidghorabi1864 2 жыл бұрын
Hello Ali. could you please help me how define the distance between the current candle, and the last point that ema10 crossed ema20, in SQX.
@StatOasis
@StatOasis 2 жыл бұрын
You need to set a counter when the cross happen and then close-close[counter]
@iameladlevi
@iameladlevi 2 жыл бұрын
As always - amazing. Pure gold :) 1 question- when using a daily bars , and once you have dollar amount for sl/tp, how does the backrest know which one hits firsts? I mean assuming that the candle was big enough to include both of them. I do know that this is a problem when doing back test without look inside bar data.
@StatOasis
@StatOasis 2 жыл бұрын
you are correct, you need to drill down to 1 minute time frame to see which one happen first, you can do that by trading one minute chart while the signal is coming from daily chart. also most platforms have the ability to test the strategy using 1 minute bar (higher resolution) to see which threshold triggered first
@iameladlevi
@iameladlevi 2 жыл бұрын
@@StatOasis I’m facing this issue when using TS protfoli maestro. When testing long periods using daily bars, we can’t tell if our results are right or not. And looking inside bar is only valid for last few days. Working with minutes bars is an option, but retrieving the data and running the analysis is timely cost . Thanks Ali!
@StatOasis
@StatOasis 2 жыл бұрын
you can mitigate that by pushing PT to 2 ATR roughly so SL and PT probability of hitting in the same bar is a lot less. just to get an idea, then you can test on 1m for all instruments
@iameladlevi
@iameladlevi 2 жыл бұрын
@@StatOasis You are truly a treasure Ali. Glad to find your amazing channel, with true , tested, no BS , useable information. I’m a true fan. Thanks again!
@binhsir
@binhsir 2 жыл бұрын
@@StatOasis trading one minute chart while the signal is coming from daily chart,that is good and simple mathod. I am very surprised that SQX can't support higher resolution restesting function for TS/MC engine, it looks simple to implement
@md-oe4wg
@md-oe4wg Жыл бұрын
Great video. What is the starting capital allocated to each instrument for the portfolio that has generated approximately $1.7 mill profit.
@StatOasis
@StatOasis Жыл бұрын
by default TS & MC start with 100K, but almost all of my youtube strategies are traded with fixed one contract
@khaledarja9239
@khaledarja9239 2 жыл бұрын
Ali that's pure gold ! Thanks!! When are you planning on opening the enrollment for the course?
@khaledarja9239
@khaledarja9239 2 жыл бұрын
And in the couse will we see how to apply these strategies in the futures market? From sqx to ts
@StatOasis
@StatOasis 2 жыл бұрын
the course Algo Trading Masterclass "ATM" will open in couple of weeks, make sure to subscribe to email list to be notified at Go.StatOasis.com/ATM
@StatOasis
@StatOasis 2 жыл бұрын
the course will go through fundamentals of strategies, building strategies, filters, testing for robustness, automation, all in SQX. SQX can export code in plain English, TS/MC, MT4, so you copy and paste Although I trade futures, but everything can be applied to futures, stocks, forex, etfs
@khaledarja9239
@khaledarja9239 2 жыл бұрын
Yes SQX i have it because of you Ali ! But what I would like to know is whether you plan someday to cover how algo trading on TS is done, especially for contracts expirations, how is that handled if you are a long term trend follower Subscribed for the course ! And soon to be in the discord :)
@StatOasis
@StatOasis 2 жыл бұрын
unfortunately that is not a popular question on youtube, which is what I based my videos on. but when you join discord you can definitely ask and will answer in Live Q&A session, also it will be recorded and added to the Q&A database.
@ahmedsurajuddin967
@ahmedsurajuddin967 11 ай бұрын
how do you know if a market has an edge mean reverting or breakingout?? Thanks Ali
@StatOasis
@StatOasis 11 ай бұрын
There are many ways, i show three methods in my Algo Trading Masterclass. You can start with simple MR strategy and see how the market behave
@paulmathews4335
@paulmathews4335 2 жыл бұрын
You got a good reaction to this one Ali, how about getting a few of the ones that mean revert the best (whilst avoiding the overly correlated ones together) and put them in a portfolio together with the trenders, I know you have done a portfolio of mean reveterters previously but I'm a daily bar man myself
@StatOasis
@StatOasis 2 жыл бұрын
sure that is a good idea
@javedasyed
@javedasyed 2 жыл бұрын
Good Afternoon, Very nice presentation. Unfortunately this strategy did not pass look inside bar back testing, any suggestion.
@StatOasis
@StatOasis 2 жыл бұрын
I just did the retest now with 1 minute bar magnifier, Net P/L +$291K, Avg Trade $413. if you set your stop loss +5x your profit target and > ATR then you remove the probability of hitting both in the same bar without testing high resolution bars just to get an idea.
@javedasyed
@javedasyed 2 жыл бұрын
Thanks for responding, you meant stop loss 5xATR
@StatOasis
@StatOasis 2 жыл бұрын
SL 5x PT, it is definitely > 1ATR
@javedasyed
@javedasyed 2 жыл бұрын
@@StatOasis Thanks
@mitchellstewart6745
@mitchellstewart6745 Жыл бұрын
Great video, how long have you been live trading the markets? Or just demo / backtesting?
@StatOasis
@StatOasis Жыл бұрын
I started in 1999 the end of dotcom bubble
@mitchellstewart6745
@mitchellstewart6745 Ай бұрын
@@StatOasis great stuff - I came back to this video today :-) what platform do you trade with? I have been using MQL5 platform since I enjoy MQL OOP methodology, do you have any comments?
@MisterPDR
@MisterPDR Жыл бұрын
that cup and handle vodoo comment got me laughing 😂
@StatOasis
@StatOasis Жыл бұрын
😀
@GordonShamway1984
@GordonShamway1984 2 жыл бұрын
How did you find out which markets work well on which strategy type like i.e. breakout?
@StatOasis
@StatOasis 2 жыл бұрын
I have a method that I teach in my course to sniff out market edge. keep in mind not all markets have a distinct edge for breakout or mean reversion, but many do.
@av9733
@av9733 2 жыл бұрын
Hi any update of algo courses? when it will start. i have subscribed thru email but ...
@StatOasis
@StatOasis 2 жыл бұрын
thanks for subscribing. in couple of weeks, you will be notified via email
@Bajoli86
@Bajoli86 2 ай бұрын
Please redo this strategy but then with commitment of trader reports to decide long only or short only during certain periods. It could be an even better strategy. I think Larry williams used a similar strategy during his world record, he didn''t just use a breakout strategy, he combined it with COT during his world record run.
@StatOasis
@StatOasis 2 ай бұрын
Will add it to post ideas
@agentdark64
@agentdark64 2 жыл бұрын
What symbol do you use for gold futures? I use broker FXTM, but i don't see any gold futures, only XAUUSD.
@StatOasis
@StatOasis 2 жыл бұрын
I am testing this on futures markets, I think XAU is a CFD, but it doesn't hurt to test, of course you will have different values for SL, PT, BE as the point value for XAU is different than @GC
@iameladlevi
@iameladlevi 2 жыл бұрын
Also at 7:53 - 182,000 is not the lowest one as you can see at lines below that. Guess the sort is by something different. Am I right?
@StatOasis
@StatOasis 2 жыл бұрын
I did 3 criteria sorting at one point, but I don't remember if that was in the final edit
@StatOasis
@StatOasis 2 жыл бұрын
how to use ADX as a filter for your strategy: kzfaq.info/get/bejne/f5p1dpeXp5jOZIk.html
@pdoty3335
@pdoty3335 Жыл бұрын
I went back and tested this strategy after final optimization, 15-25-45, I put the exact dates you used at the time 1/2/200 thru 3/1/2022, limiting entries and exits from all signals in the strategy to once per bar. Many numbers came up the same, except total numbers of trades, I had 743, and net profit of 310K. I dont know why im consistently coming up with so many more trades than you, within the same parameters. Now I know perhaps Im being picky, (I prefer thorough). Just wondering what the discrepancy might be. Excuse so many questions lately, Ive been testing quite a bit lately, your strategies, which are wonderful :)
@StatOasis
@StatOasis Жыл бұрын
No worries, if u have the same code using same data same platform then it should match 100% But like u mentioned if beginning/end dates change of course it will change number of trades
@pdoty3335
@pdoty3335 Жыл бұрын
@@StatOasis using TS...I ended up with 60 more trades than you. Re: This comment you made: StatOasis 1 month ago I just did the retest now with 1 minute bar magnifier, Net P/L +$291K, Avg Trade $413. if you set your stop loss +5x your profit target and > ATR then you remove the probability of hitting both in the same bar without testing high resolution bars just to get an idea. When you say stop loss +5x your profit target and > ATR Do you mean that the profit target should be 5 times higher than the stop loss as it was in the Natural Gas presentation?
@StatOasis
@StatOasis Жыл бұрын
yes, you are correct, the ATR is great help here, because it will tell you on average how much the market move per day, so if there is 3 ATRs between PT and SL, it will be hard to hit both on the same bar (not impossible though), so 5ATRs should be even less probability. if you use longer period ATR (>20) then the probability will increase a lot, because ATR will take longer to adjust to higher volatility.
@pdoty3335
@pdoty3335 Жыл бұрын
So for this type of strategy, you recommend a profit target that’s 3-5x higher than the stop loss?
@StatOasis
@StatOasis Жыл бұрын
The difference is 5x, so you can have 3ATR SL and 2ATR PT that will make distance between them 5ATR
@zennydmt
@zennydmt 2 жыл бұрын
What do 5000 and 500 refer to? Pips?
@StatOasis
@StatOasis 2 жыл бұрын
they refer to amount in $
@iameladlevi
@iameladlevi 2 жыл бұрын
What is the amount of capital for each strategy in the portfolio?
@StatOasis
@StatOasis 2 жыл бұрын
portfolio starts with $100K for all strategies
@iameladlevi
@iameladlevi 2 жыл бұрын
@@StatOasis So no separate capital for each symbol?
@StatOasis
@StatOasis 2 жыл бұрын
no
@ngna2770
@ngna2770 2 жыл бұрын
How to make an ea with this ?
@StatOasis
@StatOasis 2 жыл бұрын
Do it in SQX and export the code
@ngna2770
@ngna2770 2 жыл бұрын
@@StatOasis need step by step tutorial,:( still create no EA that is profitable with SQX,VERY FEW TRADES, no profits
@pdoty3335
@pdoty3335 Жыл бұрын
In Format Strategy > Format > Calculation Version 9.5 Do you choose to 'Enable intrabar order generation and calculation"? If so, which options do you check? I ran the 15-25-45 strategy, from 8/2001 to 8/16/22 I 'Enabled order generation etc.' And chose: 'Limit entries from all signals in this strategy to once per bar' and, 'Allow any exit from this strategy to occur multiple times per bar' The difference in the results of choosing to enable order generation etc, and not choosing it were huge. $352,090.00 on 967 trades (enabled) $188,580.00 on 948 trades (Order generation tab not enabled in Strategy Format) Thank You for highlighting this strategy, its wonderful. Im curious of your thoughts on my observations.
@StatOasis
@StatOasis Жыл бұрын
intrabar 1 minute is more than enough. basically you want to find out which level hit first, profit target or stop loss, if the difference between the two levels is big, one minute is more than enough. Now there might be occasions where it will be wrong, because volatility is too high and both levels might hit in one minute bar, but those are rare. I just retested the strategy 012007 to 072022 and Net Profit $86K, #trades 132, Avg Trade $651
@ngna2770
@ngna2770 2 жыл бұрын
how can i contact you?
@StatOasis
@StatOasis 2 жыл бұрын
info at StatOasis dot com or you can submit a form on my website StatOasis.com
3 Natural Gas strategies in a portfolio
12:55
StatOasis
Рет қаралды 1,4 М.
Lessons From History’s Best Traders | Market Wizards | Jack Schwager
1:15:22
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 40 МЛН
- А что в креме? - Это кАкАооо! #КондитерДети
00:24
Телеканал ПЯТНИЦА
Рет қаралды 7 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
00:56
صدام العزي
Рет қаралды 60 МЛН
Trading pullback with SQX Stock Picker Engine!
21:56
StatOasis
Рет қаралды 2,3 М.
RSI2 Larry Connors | Holy Grail Indicator!
14:26
StatOasis
Рет қаралды 8 М.
Larry Williams volatility trading strategy updated for 2021
19:06
Trend Following Trading System | The Turtle Traders!
15:02
StatOasis
Рет қаралды 6 М.
Gold Futures Contracts - The complete guide for traders
15:53
Earn2Trade
Рет қаралды 13 М.
Trading Psychology | Why Normal Doesn’t Make Money | Part 1
18:39
StrategyQuant X powerful hidden feature!
16:16
StatOasis
Рет қаралды 8 М.
Intraday NASDAQ Scalping Strategy Revealed! 💰
18:20
StatOasis
Рет қаралды 4,6 М.
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 40 МЛН