Edge Finder and Condition Tester

v11
Edge Finder and Condition Tester

This indicator can help you find out what condition or set of conditions might give you an edge in any market. It can check through all of history and record what price did after any condition or any set of conditions occurred.

This indicator only works on PRTv11 onwards.

You set ‘projection’ to how many bars after an event you want to analyse.

You can change line 10 in the code to be any condition or set of conditions that you wish to analyse. So for example it could be something like any of the following:

  • high > high[1]
  • close > average[10]
  • close > average[10] and high > high[1]
  • stochastic[10,3] > stochastic[10,3][1] and low > low[1]

The options are endless.

The indicator returns three lines drawn ‘projection’ bars into the future from the close of the last candle on the chart.

The blue line is our datum and is a line calculated from what happened after every bar on the chart. If this line curves upwards then we are trading a market that has a long tendency. If it curves down then it has a short tendency. If it is fairly level then the market might be considered to be more of a mean reversal market.

The green line shows what happened on average after a candle which met our condition/s occurred. If it is above the blue line then that is an edge. If it is below then it is a condition that gives a disadvantage.

The red line shows what happened on average after a candle which did not meet our condition/s occurred. If it is above the blue line then there is an edge to trading candles that do not meet our condition/s. If it is below then not meeting our condition gives a disadvantage.

The lines are labelled. The first number is the sample size or quantity of candles that either met our condition/s or did not meet our condition/s and for the datum line it is the total number of candles tested to get our datum.

The second number is the difference between the end of the projection line and the start of it. You can set a spread amount and this is then deducted off this result so you can see if the edge is big enough over ‘projection’ bars to actually overcome the spread.

The third number on the datum line is the percentage gain or loss compared to the start of the datum line. For the green condition met and red condition not met lines it is the difference of percentage to the datum line.

I advise downloading and importing to get full functionality.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Fabian • 04/13/2020 #

    Hi Vonasi,

    I’m a big fan of your work.

    Could you please take a look at my idea and suggestion of a live trading target calculation? I think it might go great with your other work as well.

    https://www.prorealcode.com/topic/live-target-zone-calculation-with-arrays/

    Thanks,
    Fabian

  2. MAKSIDE • 04/13/2020 #

    Good job !

  3. larouedegann • 04/13/2020 #

    HELLO
    Il faut enlever le “s” de projections dans le setting et
    çela fonctionne à merveille

    • Vonasi • 04/13/2020 #

      Yes that is a typo in the code. You should download and import the indicator as advised in the description to get full functionality.

    • IG_CFD_Trader • 04/13/2020 #

      Hi Vonassi,
      Your coding skills in PRT are amazing. Keep up the great contributions.
      I have a fairly simple request (it should be by your standard :)):
      How do I write a simple code that for example looks back at the last 100 bars and averages only positive values? For example I have an indicator that returns either a + value or – value for every bar. I want to lookback 100 bars and average only the + values (- values are skipped/ignored in average calculation)
      thank you and regards.

  4. Aristote • 04/13/2020 #

    Congratulation for this work !
    Is it possible to add an option “Startback” like your other indicator Index Projections ?

    Many thanks for this !

    • Vonasi • 04/13/2020 #

      I guess it might be a nice addition so that you can check back in history and compare whether your condition has always given an edge. In fact that has given me an idea to possibly draw lines for lots of different sample periods to check the robustness of the edge! I’m a bit busy with other stuff right now but I’ll keep it in mind.

  5. Jan • 04/13/2020 #

    Hi Vonasi,
    I tried to understand the concept behind the 3 lines.
    “The indicator returns three lines drawn ‘projection’ bars into the future from the close of the last candle on the chart.
    The blue line is our datum and is a line calculated from what happened after every bar on the chart. If this line curves upwards then we are trading a market that has a long tendency. If it curves down then it has a short tendency. If it is fairly level then the market might be considered to be more of a mean reversal market.
    The green line shows what happened on average after a candle which met our condition/s occurred. If it is above the blue line then that is an edge. If it is below then it is a condition that gives a disadvantage.
    The red line shows what happened on average after a candle which did not meet our condition/s occurred. If it is above the blue line then there is an edge to trading candles that do not meet our condition/s. If it is below then not meeting our condition gives a disadvantage.”

    Why have you developed this visual ? What is the conceptual difference with back testing the rule with the projection period ?

    • Vonasi • 04/13/2020 #

      First of all it was a nice exercise in the use of arrays. If you back test your rule and say buy now and sell in x bars then while you are on the market you are missing all the other trade starting points that might also occur. With this indicator that does not happen. Every single candle that meets your conditions is analysed for what price did next and the lines are an average of all those price movements for every candle that your condition was met on. Also you get to compare it directly to all the candles that did not meet your condition and also against a market datum. All that is impossible to do in a strategy.

  6. Marcot18 • 04/13/2020 #

    Scusate, quindi la linea blu é dove andrà il prezzo con le maggiori possibilità di successo?
    Grazie

    • Vonasi • 04/13/2020 #

      La linea blu è ciò che fa il mercato in media se si apre uno scambio su ogni barra. È il nostro dato da confrontare.

  7. Bard • 04/13/2020 #

    Nice job @Vonasi, I was wondering though why does the positive % gain keep increasing and increasing on the Datum?
    It’s gone up 4% just in one minute and is still rising for the Daily £/Yen with Projection = 30 and Spread = 3.8?

    Condition set as: condition = stochastic[7,3] > stochastic[7,3][100] and close > average[100] and low > low[100]

    Cheers,

  8. Vonasi • 04/13/2020 #

    I’m guessing that it is a similar issue to the one that I had on the distribution of returns indicators. I developed them when we only had PRT end of day accounts to use for developing codes on using the new array coding. Now it is updating the arrays tick by tick the code needs modifying to solve the issue. I’ll try to find sometime to do it.

  9. Bard • 04/13/2020 #

    Great, I look forward to the update as this is a very interesting and useful indicator.

    Btw, although I’m a technical trader the first Condition that actually sprang to mind was the impact of Federal Reserve meetings and interest rate decisions on the Dow and Cable.

    I tried the condition code for those specific interest rate decisions, (Jan 27th and March 17th’s etc) but it doesn’t produce all the three coloured lines — sometimes it produces just the red and blue lines but not the green line and other times no red line, just blue and green?

    I tried using:

    ONCE StartDate = 20200331 or 20200428 or 20200609 or 20200728 or 20200827 or 20200915 or 20201104 or 20201215 or 20210127 or 20210317

    Condition = StartDate

    And I also tried:

    Once StartDate = 20200331 and Time = 18000 or StartDate = 20200428 and Time = 18000 or StartDate = 20200609 and Time = 18000 or StartDate = 20200728 and Time = 18000 or StartDate = 20200827 and Time = 18000 or StartDate = 20200915 and Time = 18000 or StartDate = 20201104 and Time = 18000 or StartDate = 20201215 and Time = 18000 or StartDate = 20210127 and Time = 18000 or StartDate = 20210317 and Time = 18000
      
    Condition = StartDate

    … but couldn’t get it to work, so I’m wondering how to code these dates it to see the impact of how price changes after these meetings?

    Cheers.

  10. Vonasi • 04/13/2020 #

    It should be condition = (opendate = 20200331 and time = 001800)

  11. Bard • 04/13/2020 #

    Thanks @Vonasi. I’ve coded the Fed meeting dates condition below — from last March 2020 to this March 2021 — but I only get a blue datum line going up and a green line going out horizontal? Is what I’m testing feasible to get a 3 lined result? Cheers.

    If (OpenDate = 20200331 and time = 001800) or (OpenDate = 20200428 and Time = 001800) or (OpenDate = 20200609 and Time = 001800) or (OpenDate = 20200728 and Time = 001800) or (OpenDate = 20200827 and Time = 001800) or (OpenDate = 20200915 and Time = 001800) or (OpenDate = 20201104 and Time = 001800) or (OpenDate = 20201215 and Time = 001800) or (OpenDate = 20210127 and Time = 001800) or (OpenDate = 20210317 and Time = 001800) Then
    Condition = Opendate
    EndIf

  12. Vonasi • 04/13/2020 #

    Why have you got Condition = Opendate in there?

  13. Bard • 04/13/2020 #

    Because I want to test how the mkt reacts to Fed FOMC’s so the condition is those specific dates (and time) and what happens on them.

  14. Vonasi • 04/13/2020 #

    I’m not sure that you understand how conditions work! Condition = opendate will always return true. Delete the IF THEN and replace everything with CONDITION = (OpenDate = 20200331 and time = 001800) or (OpenDate = 20200428 and Time = 001800) or (OpenDate = 20200609 and Time = 001800) or (OpenDate = 20200728 and Time = 001800) or (OpenDate = 20200827 and Time = 001800) or (OpenDate = 20200915 and Time = 001800) or (OpenDate = 20201104 and Time = 001800) or (OpenDate = 20201215 and Time = 001800) or (OpenDate = 20210127 and Time = 001800) or (OpenDate = 20210317 and Time = 001800)

  15. Bard • 04/13/2020 #

    Put it down to misinterpreting some Date and Time posts here on the forum (that always use, if or once) and not being a coder! What is the difference between defining a condition first with “if” or “once” and then referring to those conditions (i.e. FOMC dates) with Condition = OpenDate, — because after all, isn’t that the only times we’re interested in defining and all other dates will return not true — and the correct method of just using Condition = OpenDate and writing a long list of dates and times after it?
    Cheers,

  16. Vonasi • 04/13/2020 #

    My code sets the condition and this return either true or false for every bar. It then checks at each bar to see if it is either true or NOT true using two IF THENs. ONCE should only be used if you only want to set the condition state on the first bar of a chart only.

  17. Bard • 04/13/2020 #

    Thanks for the explanation.

  18. Bard • 04/13/2020 #

    I just made some time today to load up the correct FOMC conditions in PRT but I still get only a blue and horizontal green line for hourly or daily charts?
    Pls see Dropbox image (click “x” in the top right of the “create account” pop up.
    https://www.dropbox.com/s/tv56fa4bqszpygi/edge.png

  19. Vonasi • 04/13/2020 #

    We already spoke about the fact that the indicator needs further development and bug fixing as it was created on PRT v11 pre tick by tick data. At the moment I am not coding because I threw a cup of tea over my keyboard and I am waiting for replacement to be delivered from UK to Greece (subject to Brexit created delays and costs). I am currently limited to using an old bluetooth keyboard that misses a lot of typing and is very annoying to use while I wait for the replacement to arrive. Please be patient!

  20. Vonasi • 04/13/2020 #

    Just typing the last reply took ten minutes and a lot of swearing!

  21. Bard • 04/13/2020 #

    OMG, I am sorry for your loss! I once “accidentally” threw a small bottle of mineral water at my Macbook. Needless to say it did not bounce off the screen nor make trading that day any easier!

  22. Bard • 04/13/2020 #

    Hi @Vonassi, just wondering if you’d had a chance to take another look at developing this great indicator? Cheers.

    • Vonasi • 04/13/2020 #

      Sorry – I’m not coding anything at the moment.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Bard Hi @Vonasi, this is an excellent tool! I noticed you times by 180 and was wondering why? W...
Bard I have no idea what is wrong with the posting on this website. I have problems editing posts...
Bard And now my first post displays okay? It literally had copies of my orig post all added toget...
Vinks_o_7 Vonasi you're a beast !!! ;-)))
pableitor Amazing indicator , you are pushing PRT to the limit! But looking at the scatter its not c...
Vonasi I can't add any images here now that the library post has been listed. Perhaps you could sta...
Vinks_o_7 Thanks again Vonasi !
Bard Thank you, this is a great tool @Vonasi, especially for those that used to like shorting Ind...
sycomore Ça ne fonctionne sur aucune valeur, je dois être trop con...
Nicolas il faut appliquer l'indicateur sur le prix.
AntoGH Je crains de ne pas comprendre... Cela indique la probabilité de la prochaine bougie ou donn...
GraHal Wow! Thank you Vonasi, great idea!
Vonasi No Problem GraHal. Please share anything interesting that you find using it.
Vonasi I've made a small improvement by adding a Buy and Hold line for comparison. This line can be...
Vonasi Thanks for your thanks Real Pro and yes everyone should import the itf file to make sure tha...
Pepsmile Good job, which could be applied for a spectrum of another indicators.
Pepsmile As to better understand which parameters are better for an indicators in a specific period (...
Bard I was talking to a Machine Learning coder today who's algos have apparently managed to get 7...

Top