Possible to check onMarket on a different timeframe?
Forums › ProRealTime English forum › ProOrder support › Possible to check onMarket on a different timeframe?
- This topic has 11 replies, 3 voices, and was last updated 2 years ago by
PeterSt.
-
-
11/30/2022 at 9:41 AM #205052
I’m wondering if anybody knows if it possible to check onMarket on another timeframe (MTF)?
Would be very useful when you have a trading system that often reach limit orders on the same bar as it is opened. I want to move stop and today i have to wait for the next bar to check onMarket and then move stop…
11/30/2022 at 9:45 AM #20505411/30/2022 at 10:06 AM #205057Alright! I have never used MTF but sounds like that’s about to change 🙂
Just did a quick test and i’m a bit confused about the multiples. Let’s say i have a system running on 1 min and then wants to check onMarket on 1 second. Then i have trouble looking down in time. But if i do the opposite – running 1 second chart looking up to 1 min to define system and enter orders – it works. The problem with that is backtesting data. I get no orders since 1 second chart don’t get me enough days of trading.
How would you run 1 min chart but look down to 1 second to manage onMarket?
11/30/2022 at 12:23 PM #205065I often use ONMARKET in an inferior to timeframe to know if a pending order has triggered during the bar.
How do you do that? If you have a system running 1 min and you want to check if a order have been triggered during the bar. After reading some documentation and some coding attempts it looks to me you only can look up in time… A 5 min chart can’t use timeframe(1 min), but a 1 min chart can use timeframe(5 min).
11/30/2022 at 1:33 PM #205067Check your orders in an inferior timeframe, look below:
1234567891011timeframe(1 minute, updateonclose)//HERE IS LOCATED YOUR STRATEGY LOGIC (CONDITIONS)if buyconditions thenbuy at marketendiftimeframe(default)//HERE YOU CAN CHECK WHATEVER YOU WANT ON THE TIMEFRAME WHERE THE STRATEGY IS STARTEDif longonmarket then//do somethingendifalso check this post that explain how to use MTF in strategy: First approach to multi timeframe trading with ProRealTime
and also: https://www.prorealcode.com/topic/move-sl-during-current-candle/#post-79130
1 user thanked author for this post.
11/30/2022 at 3:21 PM #20507211/30/2022 at 3:34 PM #205074… also: https://www.prorealcode.com/topic/move-sl-during-current-candle/#post-79130
Ok, this confirms my suspicion. You cant look down in time, only up. You have to run the strategy on the lowest declared timeframe. In my case 1 second chart. Which not gives me enough days/data to have any tradesignals in backtest.
Is there another way to check if a pending order have been triggered during the bar? So i could backtest on 1 min chart to have plenty of history data…
11/30/2022 at 3:45 PM #205076you dont have to check on a 1-second basis, you can check on 10-sec? In any case, if your strategy is using logic on the 1-minute timeframe, next decisions would take place at next 1-min bar?
You can also check at next bar read if an order has triggered with:
LongTriggered or ShortTriggered
1 user thanked author for this post.
11/30/2022 at 4:28 PM #205078you dont have to check on a 1-second basis, you can check on 10-sec?
As far as I found, this does not matter for the amount of history. Once you are in the “seconds” category, you’re always stuck at (IIRC) 3 days.
This is for IG. For IB it is normally “linear”. Again, IIRC, and which has been a while ago for IB in the first place.
@Johan – the trick would be to backtest at the minute level, and check the technicalities (as per your own ideas) at the seconds level. Thus, when the strategy works out (you bachtested at the minute level for the past 6 months), you can additionally gain with the detailed exits. Usually you can check for that detail (does it work ? – does it indeed bring more profit ?) for the past few days only – now thus at the seconds level. Or … for the infinite forward testing future (just let the Backrest continue after starting it for the current day or so, at the seconds level).11/30/2022 at 5:11 PM #205082You can also check at next bar read if an order has triggered with:
Have not used it before but looks promising by its name and worth a shot. Just by reading the documentation (links) i’m not really sure how to use it. Do you have some example code. A bit easier to understand how to use it when you see it in action.
11/30/2022 at 6:25 PM #205084@Johan – the trick would be to backtest at the minute level, and check the technicalities (as per your own ideas) at the seconds level. Thus, when the strategy works out (you bachtested at the minute level for the past 6 months), you can additionally gain with the detailed exits. Usually you can check for that detail (does it work ? – does it indeed bring more profit ?) for the past few days only – now thus at the seconds level. Or … for the infinite forward testing future (just let the Backrest continue after starting it for the current day or so, at the seconds level).
Not sure if i understand you correctly… 1. You mean develop the core of the strategy in 1 min and see if it makes profit (without exact stops) and then move to 1 sec, add stops and check again. 2. If there’s no trades due to lack of data/signals, put the system to work and wait a few days/weeks?
That would be a solution but i’ve already tested to move to 1 sec and there was no trade signals as of today and since my system has an average of 0,3 trades per day, putting it in action and wait is a slow process and not really efficient enough.But as i said i feel i did not really understand.
11/30/2022 at 6:51 PM #205085Still that is what I meant. 🙂
However …
I feel it would be doing “difficult” if you exit on that detail with 0.3 trades per day. This is hard to explain, but (to me) this does not match with a 1 second detail. In other words (as how it is in my mind) :
With one trade per 3 days it better be a very good (entry) one, and you can easily wait a minute on a nice trailing (etc.) exit. Of course the detailed exit will make it better again, but to what percentage on 1 trade per 3 days ??
Think trades which run for a month, for better understanding. What you would gain (in percentage) on the detailed exit would be as large or small as the one trade per 3 days. Thus, the $$ would be equal (only weigh in the exit part, now per second instead of per minute). So see ? your number of trades must be larger to benefit from the better Exits.… But I think you are saying similar …
And back to the general idea : you can use the 1 minute TF to BACKtest your Strategy for taking more trades. This is unrelated to the Exit and you can backtest many months … Once you are satisfied with the number of trades (Entries) you can engage the 1 minute TF and FORWARDtest on the 1 second system which does not bother you and is even fun to watch.
Notice that forward testing is quite the same as letting the system run in Demo (Papertrade), but that you might need your graphing/debug data and that only works with Forward testing (no graphing possible per your commands from Demo and Live trading – look for Graph and GraphOnPrice)I hope you will achieve what you want and have fun with it !
Peter1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on