[beta-testing] multi timeframe support for automatic trading, ideas are welcome!

Forums ProRealTime English forum ProOrder support [beta-testing] multi timeframe support for automatic trading, ideas are welcome!

Viewing 15 posts - 121 through 135 (of 288 total)
  • #76749

    Indicators have always updated themselves on the fly, live, you’ll notice that looking at charts, especially on lower TFs, but you could only access them on closure of each bar.

    Now you can access them while higher TFs are forming, this is by default. UPDATEONCLOSE will change this setting letting you access only values at the time of the last closed bar.

    So referencing an MA on a daily chart from a 1-hour TF will return 24 different values. With UPDATEONCLOSE one value will be returned 24 times, that of the last close.

    2 users thanked author for this post.
    #76750

    It’s only since MTF that the Daily Indicator code would run other than at close of the daily bar??

    No – indicators have always shown the latest on the fly value and not been fixed at the close value until the candle has closed. Now with MTF we can decide whether to take this ever changing value or wait until the candle closes and just take the last closed candle value.

    1 user thanked author for this post.
    #76751

    Think of MTF values for ‘updateonclose’ and ‘default’ as what you see if you apply this indicator to a chart in any time frame that would be a non default time frame. The default time frame will always be ‘updateonclose’.

    You will see that ‘default’ is ever changing while the candle is still forming and ‘updateonclose’ is fixed to the last candle close value.

    1 user thanked author for this post.
    #76752

    Right I’ve got it now, thanks guys!

    Rightly or wrongly (?) I think I’m going with default so I get the 24 values … to use Roberto’s example below! 🙂

    robertogozzi wrote:
    So referencing an MA on a daily chart from a 1-hour TF will return 24 different values.

    But I need to sleep on this and test it out more as somehow default feels like I’ll be using MTF in a way that is not being true to the higher TF. Maybe it doesn’t matter as values will be optimised for whichever method.

    If for example using MACD on a higher 5 min TF (with the chart TF at 1 min) then as the MACD crosses over 0 / zero at 3 minutes into the 5 min bar them my (1 min) System opens a BUY then I might meet my target profit and exit by the time the true 5 minute / updateonclose  Systems have waited the extra 2 minutes only to find that the MACD then drops back below 0 / zero! 🙂 🙂

     

    #76761

    There is no wrong or right. If looking at a monthly time frame value in your code then you might find that using ‘updateonclose’ is better as many will look at the last closed candle and say it was a down candle so that tells me a lot about market sentiment at the beginning of the month. However on the first of the month the new months currently forming ‘default’ candle will tell you nothing at all and so be pretty unusable for trading decisions – because for the first few days of the month it might be down and then up and then down – changing second by second before finally settling nearer the end of the month for whether it is likely to close up or down.

    ‘Default’ has the disadvantage of giving too many signals. If you are for example looking for a crossover in a five minute time frame then you could have dozens that whipsaw you in and out of a trade!

    Maybe we should be looking at both values ‘updateonclose’ and ‘default’ and only trading if they are in agreement or disagreement depending on our strategy type?  Now there is a new idea to test!

    1 user thanked author for this post.
    #76800

    Like I wrote in my article: the code is still read only one time per bar, it has not changed! 

    And it is always the lower timeframe declared into your code that make this happen.

    Example: if you have a 1 hour strategy, but you want to evaluate the code more often between two 1 hour bars to move your stoploss according to the price movement, then you can use the 5-minute TF to do it:

     

    #76809

    The following helps to see what the difference is I think.

    Screenshot_11

    Applied on a 5 minute chart it can be clearly seen that the value of the ‘updateonclose’ changes just once at the beginning of a day and is held at that value throughout the whole day – resulting in a very squared off graph line. Where as the ‘default’ value changes every time a five minute bar closes.

    #77014

    I think that I might be falling in love with MTF!

    I just used it in a ‘fake’ strategy that graphed median price over various time frames and I very quickly spotted a pattern. Within a couple of minutes I had turned it into the simplest of strategies and here are the results.

    Screenshot_6-5
    Screenshot_7-3

    It is a daily long only strategy with just one variable and that is in a very general and simple bear market filter. The equity curve shown is for a level stake of 1 and spread of 2.4 on the DJI since the end of 1986. The average trade length is 1d 5h and 6d 7h between positions. The largest number of positions held was 8 and the longest trade was 15 days.

    When you create something this simple and it works straight out of the box it is very satisfying. Hopefully it will work as well on some other indices. It happened to be named MySystem(123) so I think I might give it the strategy name of ‘Easy as 123’!

    I am in love with MTF! Thank you PRT for giving it to us.

    #77020

    Hi,

    So just to clarify, currently when you use the simplified creation tool and you set up a statement like SELL/BUY 10, they is a tab that says “Next Bar Open”

    Is my understanding correct in saying that the new feature will now execute an order as soon as a  condition is met(instantaneously) rather than waiting till the next bar/candlestick to open/appear ?

    Kind Regards,

    Simone

     

    #77026

    No, NEXTBAROPEN is ignored and is kept alive just to let old strategies run without errors.

    MTF did not change this behaviour, code is still read when a bar CLOSES in the default (lowest) TF.

    What is different now is that you may combine different TF’s (provided they are all multiple of the default one), so you can simulate opening a trade in any moment. If you deal with a Daily TF but use 1-minute as default, you’ll be able to open a trade any minute of the day referencing daily indicators and data, but only when the 1-minute bar closes!

    #77028

    No. I don’t think MTF is yet part of the simplified creation tool. That option ‘Next Bar Open’ is a bit of a redundant option as that is the only choice in PRT!

    All trade decisions are made at the close of the bar in the time frame you are working in and so trades opened at the next bar open.

    If you are manually writing a code then the chart time frame you are trading on is considered the ‘default’ time frame. With MTF you can now use values and conditions from slower time frames in your strategies decisions rather than just the values and conditions in the default time frame that you are trading in. These values and conditions can be either based on the last candle closed in the slower time frame or the current values/conditions at the close time of your candle in the default time frame. Slightly confusing but easy once you get the hang of it!

    #77029

    I think we are talking over each other and saying the same thing Robert!

    #77031

    “Next Bar Open” in the assisted creation tool has nothing to deal with MTF.

    #77033

    Vonasi,Roberto and Nicolas

    Thanks for answering as I am a bit of a newbie to language and platform. Essentially I just want to ensure that when I automate orders they are done as soon as a condition is met rather than delayed to the close of the timeframe that I am using. So if you could provide some documentation or tips on this that would be great.

     

    Regards

    #77034

    I just want to ensure that when I automate orders they are done as soon as a condition is met rather than delayed to the close of the timeframe that I am using

     

    Everything is decided on the close of a candle. With MTF you could use a fast time frame and check your indicator in a slower time frame to achieve something similar but only with manual programming. The faster the time frame you use as default the less back testing data you will have available. MTF is not available for live trading yet

Viewing 15 posts - 121 through 135 (of 288 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login