Probability of a run of events being followed by another event

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #104170 quote
    Vonasi
    Moderator
    Master

    Here is  little indicator that allows you to measure the percentage of times in history that a run of events has occurred and all resulted in a second event. So for example if a week ends down how often has there been a run of 3 times in a row of that week being followed by an up week? In the image shown we can see that there has been 121 times that a run of three down weeks followed by three up weeks has occurred which is only 20% of runs managing to reach three. These three first events do not have to be in three candles in a row because the indicator just ignores candles where the first event does not occur and just uses those where it does.

    Obviously the runs will depend on your starting point and also a run of 6 is actually 4 runs of three (bets 123, 234, 345 and 456)but we only see it as two runs in this simple indicator.

    The idea for it came from thinking about the gamblers way of putting everything on red and if it comes up red then putting everything on red again and if that wins do it again! What are your chances of winning that series of bets? Well now we know that if we keep betting on every down week on the DJI that it will go up the next week our chance of winning all three bets is just 20%.

    You can change the events in the indicator to test all sorts of things to maybe find a better edge.

    I’m sure that I wrote a far more complicated candle run analyser a while back which I think I made a topic about.

    run = 3
    
    condition1 = close < open //First event
    condition2 = close > open //Second event
    
    if win = run then
    win = 0
    yes = yes + 1
    endif
    
    if condition2 and condition1[1] then
    win = win + 1
    endif
    
    if not condition2 and condition1[1] then
    win = 0
    no = no + 1
    endif
    
    perc = (yes / (yes + no)) * 100
    
    return win as "run", perc as "percentage", yes as "total"
    Screenshot_9.png Screenshot_9.png
    #104172 quote
    Vonasi
    Moderator
    Master

    I knew that I did something similar before!

    Same Candle Run Analysis Tool

    Same Candle Run Analysis Graph

    The coding is a bit clunky as it was in my early days of learning PRT code!

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

Probability of a run of events being followed by another event


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Vonasi @vonasi Moderator
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by Vonasi
6 years, 6 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 08/04/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...