multitimeframe adventures / synthetic “stop and limit” order
Forums › ProRealTime English forum › ProOrder support › multitimeframe adventures / synthetic “stop and limit” order
- This topic has 5 replies, 2 voices, and was last updated 50 minutes ago by
justisan.
-
-
05/07/2025 at 3:08 PM #246869
hi all,
while trading dax futures on the “short” side with some of my algos I noticed quite substantial difference to my disadvantage (not that big when trading on the “long” side) between real results and backtest, and figured out that the diffirence is basically due to the slippage. those algos enter positions with stop order – and my oberservation was that I have very frequently slippage of at least 2 points, almost no entries are with no slippage (exactly stop-level), and many, really many are bigger and much bigger than 2 points, like 4-5-6 and sometimes even more than 10 points. well, that is really a lot! and then I observed that prices frequently slip within seconds and very heavy through my stop-level, yet I notice as well, that they almost always come back very soon to my stop-level, too. I was thinking then about solution, thinking about what if I enter my positions with limit order – just how to implement it? because according to my knowledge, with PRC/PRT/IG/IB combined “stop and limit” order is not supported. but then – hipp hipp hooray! – multitimeframe (MTF) came into my mind! one can make synthethic “stop and limit” order with MTF! you make all your calculations on higher time frame, in particular there you calculate the “stop level” for entry – and at the lowest possible time frame whenever prices reach/cross your “stop level” you let the algo place real limit order for entry.
cool, I thought, transformed my algo from pure 10min TF to 1sec+10min, backtested – all looking fine, kicked it off live – nothing happens. WTF is happening with this MTF?.. after long thinking and testing I figured out that the issue is: there are too few bars loading in order to make my calculations on 10min TF. as you might know, on MTF live “only” max 10k bars are loading – base being the lower TF. on 1sec TF it’s not even full 1 day, and for my calculations I need data from past day(s)… the issue seems to be: yep, you can combine even 1sec with 1hour or 1day or 1month TF, as long as on those higher TFs you access as “data” PRT’s/PRC’s default indicators, but not your own calculations trying to reach that far into the past, as your own calculations can be performed only on past 10k bars – in case above on 10k past 1sec bars – and their equivalent on higher TF. ok, I don’t use any indicators at all, so I moved to 10sec bars as lower TF instead of 1sec, so I have enough past data for my own calculations. and hell – it worked! it worked very well in live trading, ecactly as expected, and that is the reason I share this experience, for all those who might be interested in the general concept using MTF as tool in order to place synthetic “stop and limit” order.
what might be the issue with lower TF being 10sec instead of 1sec. one has anyway the issue with limit orders that entry might “never” happen, one misses the trade completely (or gets filled with less contracts than intended). and the chance for missing the entry is simply bigger when one operates on 10sec TF than operating on of 1sec – in those 10sec markets might simply move too much and “never” come back. ideally I would aim to operate with 1 tick as lower “TF” just in order to have biggest chance for intended entry – but one cannot combine 1tick with some TF measured in sec, min, hours etc.. but as far as my backtest and live experience showed, I do not see serious disadvantages, at least not yet, some things got even better than without this kind of synthetic “stop and limit”. I have now to leave my pc, but in few days I will come back with some stats, which might be of some interest.
cheers
justisan
2 users thanked author for this post.
05/08/2025 at 9:04 AM #246891Thanks for sharing! Would love to see example code on how you did it, comparing your first code that didnt work with your new MTF code that worked! Looking forward for the stats update 🙂
05/09/2025 at 10:54 AM #246921Thanks for sharing! Would love to see example code on how you did it, comparing your first code that didnt work with your new MTF code that worked! Looking forward for the stats update 🙂
I did precisely nothing with the code in order to enable live trading, just moved away from 1sec as lower TF to 10sec – which gave my algo then enough past bars for calculation of entry triggers on higher TF = 10min
05/09/2025 at 12:33 PM #246922…comming back finally with some stats and more thoughts…
please consider that results are all based on backtest, not live trading. backtest goes some 11 months back (max possible), live I was kicking off the algo mid of march approx.
so, basically when one is facing 3 options when intering market with “my” synthetic stop+limit order instead of stop or market:
- you miss the entry completely (or partially) – and that I consider biggest risk
- you enter at exactly at the limit level
- surprise suprise – you enter with positive “slippage”!
reg.1: being my biggest concern, I was very eager to see how many entries I will really miss and what is the impact.
result: 4 entries missed, and impact? – as you see in the excel/printscreed attached: synthetic stop+limit trading still shows best results in terms of total profit, profit per trade and drawdown vs “stop entries” and “market entries”.
missing 4 entries from 114 (when using stop or market entries) – well, that is still a bit of headache for me despite positive “feedback” from the backtested period. this my algo (like majority of others) is “low hit-rate” system, means – its result rely on reltaviely small amount very profitable trades while majority of trades are losing, so the worse what can happen is in fact missing one or few of those big winners. I would like to see the backtest for 11 years, not 11 months… but that is unfortunately not possible with data available on 10sec TF.
reg.2: there is not so much to be told about this, but still: according tests approx 90-95% of all entries are taking place already within first 10sec bar after issueing the limit order. that’s great and that is matching my visual observation of price dynamics after markets touching my stop-level mentiond in the initial post: heavy slipping through the stop level but also very quick reversal following. and still – kind of within the 5-10% of remaining entries there are those 4 entries which are fully lost, never filled…
reg.3: what I mean here by “slippage” is following: 10sec bar which touches/crosses entry-level due quick reversal might close well above the intended entry-level, and when at the end of that 10sec bar limit order is submitted, it will be execuded “at market” then, so at better price than originally intended entry-level. and it’s not peanuts: in the backtest 59 entries out of 110 “collect” this way positive slippage, 20 of those 59 have positive slippage >= 5 index points, and max slippage being even 17 index points. in total all those 59 trades with positive slippage accumulate 254 points of positive slippage. considering that total profit of algo in the backtest is approx 1500 points, these 254 are quite a substantial “bonus”. did not expect that…
even looking at best result in backtest being with synthetic stop+limit entries, the differences of results of all 3 entry types are not really substantial I would say. even if the real results when using stop or market entries will be probably worse than in backtest, those entries have huge advantage: you can not backtest and you can’t know for the future real trading at which prices you will get your orders filled – but you for 100% know that you will be filled, you will have all the contracts you planned. that is for me crucial – to have intended volumes with each position. going for limit entries is quite the opposite: you know your price for 100% (being intended price or better), but you never know your volume, it might vary from O to intended X, and you might miss maybe exactly those big trades/moves which you are looking for, waiting for days and weeks to appear. so what is better in the end? some hope for my new approach with limit-entries gives me the live trading: I allready had 2 algos trading shorts live with synthetic stop+limit orders during trump’s world-wide-tariffs-turbulences on 4th and 7th of April: both algos did not miss any of the entries, did great job, and that was first but also so far the only live test, which these algos successfully passed. let’s what happens in the next down-phase…
cheers
justisan
nb: this uncertainty in relation to limit entries (knowing 100% price but not volumes) and market entries (knowing 100% volumes but not the price) some moment all the sudden reminded me of “uncertainty principle” in quantum physics formulated by W. Heisenberg, for those who interested: it tells basically that by nature one can not measure two complementary parameters with 100% precision at the same time, famous example being speed and position of electron: when you know where it is, you can’t know its speed, and when you know its speed – you can’t know where it precisely is located. funny, and still it does not make trading such a rocket science like quantum physics. or does it?
05/09/2025 at 12:34 PM #24692305/09/2025 at 1:55 PM #246926Thanks for sharing! Would love to see example code on how you did it, comparing your first code that didnt work with your new MTF code that worked! Looking forward for the stats update 🙂
I did precisely nothing with the code in order to enable live trading, just moved away from 1sec as lower TF to 10sec – which gave my algo then enough past bars for calculation of entry triggers on higher TF = 10min
just to explain a bit more: when first going live was not triggering any trades, I thought I messed up something with the code – indeed conding in multitimeframe is in some way tricky. so I was “thinking long and testing”, worked on code – but nothing helped, until I realized that the original code is perfectly fine and the only reason it does not work live is the amount of the data which it received with those max 10k bars on 1sec TF in order to calculate entry-triggers on 10min TF. so I just switched from 1sec to 10sec – and then it worked as intended.
-
AuthorPosts