Multi timeframe and countofposition

Forums ProRealTime English forum ProOrder support Multi timeframe and countofposition

Viewing 13 posts - 1 through 13 (of 13 total)
  • #122913

    Hi,

    It seems like countofposition will not work on earlier timeframe then the default time frame. is this a bug or a natural error ??

    Eg.

     

    #122914

    In your program, all codes below the “timeframe (15minutes, updateonclose)” line will be read and evaluated only once each 15 minutes. If you remove the “updateonclose”, it will be evaluated once every default timeframe period.

    #122916

    Hi Nicolas,

    This would means that my code for the 15 minutes will hit 3 times (if the default time frame is 1 minute).

    Right now it wont hit at all, as the countofposition[1]>0  (15minute) will not hit at all.

    It seems to be stuck in countofposition constant zero.

    Thanks for your speedily response btw!

     

    #122927

    Line 21 will display the final value of SHOW1 (which is 0), despite being the last line. It does not matter where you place GRPAH, it will always show values retained at the end of the code.

    #122930

    This would means that my code for the 15 minutes will hit 3 times (if the default time frame is 1 minute).

    Without UpdateOnClose, it would refresh 15 times since there is 15 bars of 1 minute in a 15-minutes TF.

    Without UpdateOnClose, it would refresh only 1 time at the end of the 15-minutes TF period.

    But the result of your show15 variable will most likely be the same as the COUNTOFPOSITION[1] is the previous 15-minutes bar count of position !

    #122935

    la période de TF 15 minutes.

    nicolas meant

    with UpdateOnClose, it will refresh only 1 time at the end of the 15 minute TF period.

     

    #122966

    Hi Guys,

    Thanks for replying, you can do a simple test on your end that you know will work for you too.

    Just need to made use of countofposition as the key function in the higher timeframe then default.

     

    i modify the code below to show exactly what i meant. You can just copy the code below to see if my interpretation is wrong.

    Since 15 minutes, updateonclose. It should hit at least 5 times. but not once will it hit..

     

    #122973

    >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
    🙂

    #122983

    It should hit at least 5 times.

    Sorry but why 5 times?

    #122985

    Hi Nicolas,

    because for the 15 minutes code, i use countofposition[1]>0  and for the 1 minute code i locked it to 100 countofposition.

    So after the first 15 minutes and subsequent 15 minutes it should hit.

    countofposition[1]>0 to countofposition[6]>0 should be valid in 15minutes timeframe

    So it should hit 6 times :0

     

     

    #128118

    Hi All,

    Just to further illustrate the error:

    it seems that the error will occur only when using [] on count of position in the higher timeframe:

    Please copy the code below to try it on your end and it will be clear.

    Thanks

    #128146

    Your code is a little confusing so I created this simple test code to try to see what is happening:

    The images show the results for both UPDATEONCLOSE and DEFAULT on the 15 minute time frame. There is definitely something weird going on because in UPDATEONCLOSE mode the 15 minute count of position does not change until the 15 minute bar closes which is what we would expect but if we check the previous bar it has changed to zero.

    Then in DEFAULT mode the fifteen minute back one bar is not updating until the close of the fifteen minute bar when it should be updated every minute.

    #128150

    Hmmm ok, let me check before I ask how COUNTOFPOSITION is expected to work with MTF.

Viewing 13 posts - 1 through 13 (of 13 total)

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