Counting of Bars Incorrect Results

Forums ProRealTime English forum ProOrder support Counting of Bars Incorrect Results

Viewing 15 posts - 1 through 15 (of 16 total)
  • #70774

    I wrote a very simple strategy to test some ideas but I noticed that it was not opening every position that it should. It should simply open a position if there has been four red candles after a green candle and then closes the position after holding for one bar. I used a FOR DO NEXT loop to count but when compared to my Same Candle Run Graph indicator that is in the library which uses multiples of close < open it can clearly be seen that trading opportunities are being missed.

    Can anyone explain why this should be?

    Tested on FTSE100 Weekly.

    Bar-Count-Wrong

    Wrong-Count-2

     

    #70778

     

    #70780

    So I re-wrote the code to do away with the FOR DO NEXT loop and the results are exactly the same. Trades are missed.

    Strangely similar code in my indicator but displaced by one bar so as to run it as an analyse tool works fine.

     

    #70781

    I think you have it wrong Robertogozzi. The green bar should be before the four red bars.

    I’ll try this: (but I do not understand why the other two methods do not work as a strategy when they do as an indicator)

     

    #70782

    No that does not work either. I’m beginning to think it is an issue with the data. I still don’t understand why it works as an indicator one bar later though.

    #70783

    Here is another example: This one was looking for five reds after a green but it opens a position when the last of the five is in fact a green.

    Wrong-again

    The code used was this:

     

    #70787

    I tried it on Gbp/Nok, 1 minute, and it works fine!

    #70790

    Weekly timeframe? Try in other ones to see how it goes..

    #70793

    Weekly timeframe? Try in other ones to see how it goes..

    Yes but why does it not work in weekly? Is there something about the weekly closing data that is incorrect? If so it will make the new multi time frame feature pretty useless.

    The data is correct if you wait a week before making the decision that you should have bought at the beginning of the week as my indicator proves!

    I will check other time frames and report back…..

    #70798

    I just checked on daily data and all seems to be working correctly across a range of different same bar runs but then I tried it on a 6 (x) Days chart and something is very wrong there. There are trades opened that should not be opened. They are winners but that is not the point! The strategy was set to open a trade if a green bar is followed by four red bars. The graph at the bottom is my Candle Run indicator.

    3-extra-trades

    Bar-Count

    #70802

    Only briefly interrupting my silence in case this might help: could it be the good old custom choice of “not displaying weekend data” in the platform local options? … resulting in probuilder indicators working as you expect with friday close being also weekly close, but backtests & pro-order strategies running on prt servers with weekend data regardless of your pc-localised-only custom choice (not run on your pc displaying therefore only a subset of data excluding weekend and sunday close, yet used)? Might be consistent with weekly and x days timeframes behaving differently depending if running a strategy or an indicator.

    #70803

    This is ticked for every market where it is an option.

    Screenshot_2

    #70810

    Something is definitely not as it should be. Here is an image from a strategy based on bars that represent 25 days on the DAX and strategy that does not use tick by tick data. PRT only opens and closes positions at the open of the new bar so how is this possible?

    Maybe this needs moving to the PRT platform support for PRT to comment on?

    Dax-25-days

    #70988

    Any thoughts from anyone about what is going on here? These strange results are making market analysis impossible for me at the moment.

    Should this thread be moved to PRT platform support?

    #71140

    I’ve started a thread in the platform support forum with a link to this thread so that hopefully someone from PRT will pick up on this issue and explain what is going on.

Viewing 15 posts - 1 through 15 (of 16 total)

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