MULTITIMEFRAME AUTOMATIC TRADING

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #218961 quote
    maleczek
    Participant
    Junior

    Hello,

    I have been wrestling with TIMEFRAME for a while trying to get a particular result.

    I want to use an indicator in the 5 minute timeframe called zenith and upon Updateonclose of the bar it will be equal to the HIGH in that bar plus 4 points (i.e. zenith = HIGH + 4).

    I then want to BUY in any of the next 10 second bars where CLOSE is greater than or equal to zenith (i.e. IF CLOSE >= zenith THEN …).

    If the 5 minute bar ends at 080459 does the 10 second bar start at 080500 so that the 10 second bars are running in sync with the 5 minute bars?

    Is this possible as my attempts don’t work.

    Thank you in anticipation,

    Joseph

    #218963 quote
    robertogozzi
    Moderator
    Master

    Actually all bars start on minute 00 and second 00 and end on minute 59 and second 59, so the next bar, be it 4h or 1 second, will start immediately the next second, which is second 00.

    Since your setup is on a 5-minute TF, but you are working on a 10-second TF, you will have to check that both these conditions are met:

    • the current MINUTE  (not OpenMinute) MOD 5 is 00
    • the current SECOND  (not OpenSecond) is 00

    Example:

    IF OnMarket THEN
       SELL at Market
    ENDIF
    IF (Second = 0) AND (Minute MOD 5 = 0) THEN
       BUY At Market
    ENDIF
    coincatcha thanked this post
    #218966 quote
    JS
    Participant
    Senior

    Hi @maleczek

     

    Here’s an example with MTF…

    (in this example I had the trade closed after 5 minutes)

    DefParam CumulateOrders=False
    TimeFrame(5 minutes, UpDateOnClose)
    Zenith=High+4*pipsize
    TimeFrame(Default) //TF 10 seconds
    If Close>=Zenith then
    Buy 1 contract at Market
    EndIf
    If OnMarket and BarIndex-TradeIndex>=30 then
    Sell at Market
    EndIf
    GraphOnPrice Zenith
    coincatcha thanked this post
    Scherm­afbeelding-2023-08-12-om-13.35.21.png Scherm­afbeelding-2023-08-12-om-13.35.21.png
    #218968 quote
    maleczek
    Participant
    Junior

    Thank you ‘robertogozzi’ for your in depth response and thank you ‘JS’ for putting it into context … both very helpful !

    JS and coincatcha thanked this post
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

MULTITIMEFRAME AUTOMATIC TRADING


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
maleczek @maleczek Participant
Summary

This topic contains 3 replies,
has 3 voices, and was last updated by maleczek
2 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/12/2023
Status: Active
Attachments: 1 files
Logo Logo
Loading...