Probabilities Module - The Quant Science This module can be integrate in your code strategy or indicator and will help you to calculate the percentage probability on specific event inside your strategy. The main goal is improve and simplify the workflow if you are trying to build a quantitative strategy or indicator based on statistics or reinforcement model.
Logic
The script made a simulation inside your code based on a single event. For single event mean a trading logic composed by three different objects: entry, take profit, stop loss.
The script scrape in the past through a look back function and return the positive percentage probability about the positive event inside the data sample. In this way you are able to understand and calculate how many time (in percentage term) the conditions inside the single event are positive, helping to create your statistical edge.
You can adjust the look back period in you user interface.
How can set up the module for your use case
At the top of the script you can find:
1. entry_condition : replace the default condition with your specific entry condition.
2. TPcondition_exit : replace the default condition with your specific take profit condition.
3. SLcondition_exit : replace the default condition with your specific stop loss condition.
Integration
[e2] Fibonacci slicerFibonacci slicer function.
The script is a simple calculator that accepts any 2 input values and divides the distance between those values using Fibonacci proportions.
- Easy for script integration (lines 21-35).
- The function accepts any 2 values and their order doesn't matter.
- Correctly divides negative-negative, negative-positive, positive-negative and positive-positive values.
- Calculates 7 levels derived from the Golden ratio (1.618033).
Indicator Integrator StratThis strategy is based on my Indicator Integrator. The code sums the distances from the close of the price to an SMA (200 in example) with a summation period of the last 29 bars. I tuned this to NZDUSD 15min chart using 200SMA and 29 period sum. If I am reading strat tester correctly this hits a 39% gain since Mar-13 or 104 days. It has the ability to set stops and limits which they are not set at this point. There is no repainting or HA charts and other tricks of boosting a false gain. My codes are built for autotrading with some oversight, i.e stopping the autotrading prior to extreme news events on the economic calendar. I pick pairs that have low volatility so that the code does not have to act through heavy price changes.
Comments welcome