Gold futures trading strategy | Code exposed!

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

ความคิดเห็น • 91

  • @covingtoncreek
    @covingtoncreek 2 ปีที่แล้ว +3

    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. 🙂

  • @pdoty3335
    @pdoty3335 2 ปีที่แล้ว +1

    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  2 ปีที่แล้ว

      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

  • @5.56mm
    @5.56mm 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      Thank you for your kind words

  • @drorshapira1825
    @drorshapira1825 2 ปีที่แล้ว +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

  • @javedasyed
    @javedasyed 2 ปีที่แล้ว +2

    Good Afternoon, Very nice presentation. Unfortunately this strategy did not pass look inside bar back testing, any suggestion.

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว +1

      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

  • @DrMrsChaves
    @DrMrsChaves 2 ปีที่แล้ว +1

    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

  • @Bajoli86
    @Bajoli86 6 หลายเดือนก่อน +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  6 หลายเดือนก่อน

      Will add it to post ideas

  • @khaledarja9239
    @khaledarja9239 2 ปีที่แล้ว +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.

  • @MrHumbleOne
    @MrHumbleOne ปีที่แล้ว +1

    Great video, how long have you been live trading the markets? Or just demo / backtesting?

    • @StatOasis
      @StatOasis  ปีที่แล้ว +1

      I started in 1999 the end of dotcom bubble

    • @MrHumbleOne
      @MrHumbleOne 5 หลายเดือนก่อน

      @@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?

  • @iameladlevi
    @iameladlevi 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      I did 3 criteria sorting at one point, but I don't remember if that was in the final edit

  • @md-oe4wg
    @md-oe4wg 2 ปีที่แล้ว +1

    Great video. What is the starting capital allocated to each instrument for the portfolio that has generated approximately $1.7 mill profit.

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      by default TS & MC start with 100K, but almost all of my youtube strategies are traded with fixed one contract

  • @jash9897
    @jash9897 3 หลายเดือนก่อน +1

    Great video! why at 11:42 it shows a drawdown of ~$100k in 2009, yet at 11:45 it shows a max drawdown of ~$15k ??

    • @StatOasis
      @StatOasis  3 หลายเดือนก่อน +1

      the correct drawdown is in the equity curve. when you look at the yearly bars, the software is adding all drawdowns together even if they don't happen sequentially, which is of course wrong, because in reality it doesn't work like that. for example:
      win 1000 , PL=1000
      lose 500 , PL=500
      win 500 , PL=1000
      lose 1000 , PL=0
      the above MAX DD is 1000, but the software will show 1500

    • @jash9897
      @jash9897 3 หลายเดือนก่อน

      @@StatOasis got it. Thanks so much for the explanation!

  • @ahmedsurajuddin967
    @ahmedsurajuddin967 ปีที่แล้ว +1

    how do you know if a market has an edge mean reverting or breakingout?? Thanks Ali

    • @StatOasis
      @StatOasis  ปีที่แล้ว

      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

  • @Yewbzee
    @Yewbzee 2 ปีที่แล้ว +1

    Cheers Ali, thanks for sharing.

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      Thank you for watching

  • @majidghorabi1864
    @majidghorabi1864 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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 ปีที่แล้ว +1

      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 ปีที่แล้ว +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

  • @theauxnguyen150
    @theauxnguyen150 2 ปีที่แล้ว +1

    Simple but effective strategy! Thank Ali 🙏

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      Thank you for watching

    • @theauxnguyen150
      @theauxnguyen150 2 ปีที่แล้ว +1

      @@StatOasis I learn from every video of you. You are like my mentor 🤝

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว +1

      Glad to be of help

  • @rod85y
    @rod85y 2 ปีที่แล้ว +1

    Absolutely brilliant!

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      That’s so nice of you

  • @paulmathews4335
    @paulmathews4335 2 ปีที่แล้ว +1

    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

  • @Ricky-sx5el
    @Ricky-sx5el 2 ปีที่แล้ว +1

    That cup and handle wodoo science part was really funny. :D

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      😀 technical analysis is filled with them

  • @pdoty3335
    @pdoty3335 2 ปีที่แล้ว

    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  2 ปีที่แล้ว

      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 2 ปีที่แล้ว

      @@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  2 ปีที่แล้ว

      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 2 ปีที่แล้ว

      So for this type of strategy, you recommend a profit target that’s 3-5x higher than the stop loss?

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      The difference is 5x, so you can have 3ATR SL and 2ATR PT that will make distance between them 5ATR

  • @StatOasis
    @StatOasis  2 ปีที่แล้ว +3

    how to use ADX as a filter for your strategy: th-cam.com/video/I4EC4fB2j4U/w-d-xo.html

  • @GordonShamway1984
    @GordonShamway1984 2 ปีที่แล้ว +1

    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.

  • @silas1820
    @silas1820 2 หลายเดือนก่อน +1

    What is the initial account size for this test?
    Assuming you always use the same :)

    • @StatOasis
      @StatOasis  2 หลายเดือนก่อน +1

      All calculations are based on 1 contract regardless of account size.
      The account size will only play a role in DD%, i think default value is 10k or 100k.
      Thats why i talk in dollars so DD is the same regardless of account size.

  • @av9733
    @av9733 2 ปีที่แล้ว +1

    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

  • @agentdark64
    @agentdark64 2 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

    What is the amount of capital for each strategy in the portfolio?

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว +1

      portfolio starts with $100K for all strategies

    • @iameladlevi
      @iameladlevi 2 ปีที่แล้ว +1

      @@StatOasis
      So no separate capital for each symbol?

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว +1

      no

  • @ericwilber1228
    @ericwilber1228 2 ปีที่แล้ว +1

    another good one!

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      Thank you! Cheers!

  • @ngna2770
    @ngna2770 2 ปีที่แล้ว +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

  • @zennydmt
    @zennydmt 2 ปีที่แล้ว

    What do 5000 and 500 refer to? Pips?

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      they refer to amount in $

  • @MisterPDR
    @MisterPDR ปีที่แล้ว +1

    that cup and handle vodoo comment got me laughing 😂

  • @ngna2770
    @ngna2770 2 ปีที่แล้ว +1

    how can i contact you?

    • @StatOasis
      @StatOasis  2 ปีที่แล้ว

      info at StatOasis dot com
      or you can submit a form on my website StatOasis.com