Wanting to use 1 minute TF in a daily strategy

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #88727 quote
    SimpaG
    Participant
    New

    Hi!

    I am not an experienced user and are just starting to dig into this new feature timeframes (as well as coding in general with PRT).

    Right now I am working on a program that will use two signals for entering a long position: when RSI is lower than 10 and when Bollinger Band Width (BBW) is greater than 0.20.
    Therefore, I want the data from the daily TF for acknowledging when the market is about to close and my two conditions are fulfilled.
    If they are fulfilled and the market is about to close (17:25:00) i want to take position just before that (17:23:00) in order to be set for the next day in case of a gap. I do not want to take a position the day after my two signals allign. Also, I want to sell 5 days after the position has been taken, will the tradeIndex be reset after selling? These two (barIndex and tradeIndex has a few questionmarks around them regarding how it will work when excecuting the program)

    Here is where the trouble comes. I get the “All timeframes used in your code should be multiples of the timeframe used on the chart on which your strategy is applied (the base timeframe)”.
    Last time I checked 1 day is a multiple of 1 minute and therefore my question stands: what am i doing wrong matching up these different timeframes and will there be any problems with how I intended the program to work?

    Many thanks!

    SimpaG

    //*******Program that will be used in a daily timeframe*******
    
    myrsi = RSI[2](close)
    myboll = BollingerBandWidth[20](close)
    
    c1 = myrsi < 10
    c2 = myboll > 0.20
    
    timeframe(1 minute, default)
    timing = TIME > 172300
    
    timeframe(default)
    goinglong = c1 AND c2 AND timing
    
    IF goinglong THEN
    BUY 1 SHARE AT MARKET
    ENDIF
    
    IF tradeIndex - barIndex = 5 THEN
    SELL AT MARKET
    ENDIF
    #88730 quote
    robertogozzi
    Moderator
    Master

    I cannot spot TIMEFRAME(Daily) in your code?

    You didn’t tell us many details, what was the TF on your chart? I must assume there’s no DAILI TF because you launched your strategy from a DAILY chart, which is not correct!

    The TF on chart, also called main or default TF, is the one that rules and MUST be the smallest one used! BariIndex, TradeIndex,… are all referring to that TF. All other TF’s used in your strategy MUST be multiple of the main one!

    To recap, you have to launch your strategy from a 1-minute chart (the default or main TF as I already said). In your strategy you can use any additional TF provided it is a multiple of that main one!

    In your case you launched your strategy from a DAILY chart, but 1 minute is NOT a multiple of a DAY (it’s the other way round). From a daily chart you can launch a strategy that uses Daily, Weekly or Monthly TF!

    You will have to launch your strategy from a 1-minute chart (and you will have much less data history available!).

    Nicolas and SimpaG thanked this post
    #88831 quote
    SimpaG
    Participant
    New

    Alright, this information helped me so much in understanding how TF works!
    I am so glad that this forum exists and that there are kind people helping others out, thank you so much!

    Best

    SimpaG

    robertogozzi thanked this post
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Wanting to use 1 minute TF in a daily strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
SimpaG @simpag Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by SimpaG
7 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/15/2019
Status: Active
Attachments: No files
Logo Logo
Loading...