M15 SP500 LowBuyHighSell Strategy

Viewing 15 posts - 31 through 45 (of 47 total)
  • Author
    Posts
  • #224928 quote
    justisan
    Participant
    Junior

    so… I was taking phoentzs’ basic idea, removing some things and simplifying, what’s left you can see in the code below. please note that the “time” is local US-markets time. and then I was runing some backtests on S&P500 mini-futures on all available data, so from april 2006 till now. and I have to say it’s kind of “gold mine” 😀

    performace dashboard and equity line you can find in the pics attached.

    defparam flatafter = 151500 
    
    if intradayBarIndex = 0 then
    ordersCountL = 0
    ordersCountS = 0
    endif
    if longTriggered then
    ordersCountL = 1
    endif
    if shortTriggered then
    ordersCountS = 1
    endif
    
    if time = 151500 then
    dayC = close
    dayL = dlow(0)
    dayH = dhigh(0)
    dayR = dhigh(0) - dlow(0)
    endif
    
    if not onmarket and time < 133000 then
    
    if close < dayL and ordersCountL = 0 then
    buy 1 lots at market
    endif
    
    if close crosses under dayH and ordersCountS = 0 then 
    sellshort 1 lots at market
    endif
    
    set stop ploss dayR*0.50
    
    endif
    
    if longonmarket and close > dayC then
    sell at market
    endif
    
    if shortonmarket and close < dayC then
    exitshort at market
    endif
    sp500-dashboard.png sp500-dashboard.png sp500-equity.png sp500-equity.png
    #224933 quote
    justisan
    Participant
    Junior

    from my perspective phoentzs’ idea/approach has really plenty and very significant advantages and only some disadvantages. let me mention only selected ones.

    • avarage winners being smaller than losers you kind of rely/depend on the hit-rate being and staying > 50%. nothing really wrong with that, since the strategy by itself does not go for really huge winners and maintains moderate risk per trade. this strategy basically “fights” against the previous day’s trend, so kind of against what the “big money” is doing – one has to be aware of that not even try to seek huge profits per trade compared to the risk.
    • this strategy’s majority of trades and profits are made with entries outside main trading hours, so when volume/liquidity is really low – which is on one hand obvious disadvantage. but – I assume due to this disadvantage the strategy will be never traded by big traders/institutions with millions and billions in the pockets, and so this is a chance / a niche market for small/retail traders!
    • the equity curve is “ugly”, definetely not what majority of small/retail traders dream of. sounds like disadvantage. but I would say – it’s huge advantage, because aside from big traders/institutions not trading it due to liquidity issue, lot of small traders will be probably not trading it due to bumpy equity line which does not spit out cash every day/week/month… and that is what some other traders need – being alone, very alone with the edges one discovered.
    #224940 quote
    SnorreDK
    Participant
    Junior

    Very intressting justisan.

    Im not able to reproduce your curve with UTC+1

    For me it should look like this?

    defparam flatafter = 221500 
     
    if intradayBarIndex = 0 then
    ordersCountL = 0
    ordersCountS = 0
    endif
    if longTriggered then
    ordersCountL = 1
    endif
    if shortTriggered then
    ordersCountS = 1
    endif
     
    if time = 221500 then
    dayC = close
    dayL = dlow(0)
    dayH = dhigh(0)
    dayR = dhigh(0) - dlow(0)
    endif
     
    if not onmarket and time < 203000 then
     
    if close < dayL and ordersCountL = 0 then
    buy 1 lots at market
    endif
     
    if close crosses under dayH and ordersCountS = 0 then 
    sellshort 1 lots at market
    endif
     
    set stop ploss dayR*0.50
     
    endif
     
    if longonmarket and close > dayC then
    sell at market
    endif
     
    if shortonmarket and close < dayC then
    exitshort at market
    endif
    #224941 quote
    phoentzs
    Participant
    Master

    @justisan
    You mean I shouldn’t have spilled the beans about this system? Just so I understand correctly, “Local” time 151500 is CET 231500? So your simplified code always takes the previous day’s candle as a trigger and you have generally used half the previous day’s range as a stoploss. I’m becoming more and more convinced that this principle is a pretty robust thing.

    #224960 quote
    justisan
    Participant
    Junior

    please note as mentioned that I was running the code on futures data, and on time zone of u.s.-exchange. there main trading hours are 08:30-15:15, which usually corresponds to 15:30-22:15 CET, but not always – because of other time differences during “daylight saving”-adjustments in u.s. and europe. so you will need some tricks and effort just in order to replicate 100% correctly the time data if your run the code on sp500 cfds in the CET zone. please note as well that in my code system considers only entries from 00:00 till 13:30, so in the (CET-adjusted) line

    “if not onmarket and time < 203000 then”

    you have to add a time condition “and time >= 070000” if you run it on cfds/CET (and change to different time during dayligh-saving adjustments)

    there are other differences as well, which one has to consider when running a system on cfds vs futures, so you will probably never see exactly 100% same result on both even for exactly same code.

    phoentzs,

    my code for futures does not really look at daily/24h candle. as you see I even removed the daily timeframe. as “close” I am taking the close at 15:15 – so at the end of the main trading hours. and for day’s high and low I am taking the highest/lowest price points which where set by market from midnight through the main trading hours until 15:15= very end of main trading hours (maybe it would be enough just to consider high/low/close of main trading hours 08:30-15:15, I did not test it yet, but sure I will).

    yep, me was well – I am very convinced about robstness of your general idea/concept. you have very few very stright forward parameters, which you either cannot “optimize” at all, or which you cannot “optimize”  a lot, and even quite significant changes of some parameters do not destroy the system totally. it’s very hard to “kill” this system (unless one changes it in some way which happens to be total nonsense). and this is what one wants/needs to do – try to “kill” system, instead of “optimizing” it for beutiful equity curves (and then sell them on “marketplace” :-D). maybe it’s like serious science: scientist invent a theory – and then they try their best to falsify it, serious scientists are not trying to prove it. for “normal” people it’s very depressing approach, when it comes to science, and when it comes to trading. but “normal” people lose money in the markets, right? and lose at lot, and lose very consistently…(I mean – I am talking here my own loser-experience as well!) so “you and me” need to do/behave very ab-normal in order to make money in the markets. (see what happens right now: dax is making new all time highs – and what is the customer sentiment on IG platform? 83% are short… no need to add anything about “normal” behaviour)

    now, about you “spilling the beans” 😀 my personal view is – you should not have done it. but it is always up to you… I was also thinking some while before publishing my adjustments (still not all of them… there is a very simple way to quite significantly improve short trades of that system) and insights from s&p futures backtest. but in the end I decided to publish it – because you published your general concept. I hope folks here appreciate a lot your contribution/inspiration!

    GraHal thanked this post
    #224969 quote
    phoentzs
    Participant
    Master

    The words are very wise… and the more I think about it and deal with simple things without many indicators, the more lights come on in my head. I have coded many hundreds of systems… a lot in TF 1 minute… but my best system, robust for years, is a simple M15 system that works long and short. By the way, the basic framework is also one of my topics here in the forum. 😉 Just thinking out loud… and then a few weeks ago you opened my eyes to just trying systems without indicators. I’ve never really tried it before… what can I say… it seems to work. Not just this idea here, but other ideas too. I was probably a classic example of thinking that some magical combination of indicators would give you an advantage in the market. It’s all cheese, the simplest things really seem to be the most robust.

    #225002 quote
    justisan
    Participant
    Junior

    …I am not getting rid of the feeling/conviction that indicators were invented by brokers, system sellers, and other kind of folks who do not trade their own money (any more?…) but want “you and me” to trade (and/or buy their books and other kind of “education”). I mean – they need permanently a lot of new customers because so many are losing and dropping out all the time. So they need to offer a reason and tool for potential market players to start trading – and trade a lot. And indicators are such a marvelous “tool”! I remember myself many years ago thinking similar like: “ Wow! All these indicators! – so many ways to make money in the markets!!”. Now I have to turn this statement around: “Wow! All these indicators! – so many ways to lose your money in the markets!!”. And now “artificial intelligence” will exorbintantly increase the number of those many ways 😀

    I can still imagine that some not directly price related “indicators” like traders’ sentiment and traded volumes are of potential value for decision making.

    #225039 quote
    jmf125
    Participant
    Senior

    @phoentzs Thanks for sharing the strategy.

    What is the setting of your PRT platform in terms of timezone ? I am unable to reproduce the same results.

    #225042 quote
    phoentzs
    Participant
    Master

    It’s German time. I think this is CET+1…

    #225043 quote
    GraHal
    Participant
    Master

    Germany is CET which is same as UTC+1 which is same as London Time+1 jmf125 so you need to add 1 hour to times in code on this Topic.

    phoentzs thanked this post
    #226608 quote
    nonetheless
    Participant
    Master

    Hi Phoentzs, thanks for sharing this algo – nice idea.

    Here’s a treatment with a few small changes.

    UK times, positionsize = 5

    phoentzs thanked this post
    SP-M15-LowHigh-v3.1.jpg SP-M15-LowHigh-v3.1.jpg SP-M15-LowHigh-v3.1.itf
    #226611 quote
    phoentzs
    Participant
    Master

    @nonethless Are you back? I’m happy about that. I will test your version soon.
    At the moment the trends are too strong for my version. It copes better with sideways phases.

    #226613 quote
    GraHal
    Participant
    Master

    Hi Nonetheless

    Good to see you back around these parts, hope you are all the more wealthy for being away! 😉

    #226616 quote
    nonetheless
    Participant
    Master

    Hey Grahal, hope all is well with you. I’ve been lurking around in the background for a while, always good to see new ideas!

    GraHal thanked this post
    #226623 quote
    fifi743
    Participant
    Master

    Hi Nonetheless,
    Best wishes and good health, yes we see you less but you do more manual trading?

Viewing 15 posts - 31 through 45 (of 47 total)
  • You must be logged in to reply to this topic.

M15 SP500 LowBuyHighSell Strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
phoentzs @phoentzs Participant
Summary

This topic contains 46 replies,
has 11 voices, and was last updated by nonetheless
2 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/09/2023
Status: Active
Attachments: 17 files
Logo Logo
Loading...