User Tools

Site Tools


forex:probability

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
forex:probability [2022/12/15 11:09] – created peterforex:probability [2022/12/15 11:26] (current) peter
Line 1: Line 1:
 ====== Forex - Probability ====== ====== Forex - Probability ======
 +
 +Trading is thinking in probabilities and finding setups that make money.
 +
 +----
 +
 +===== Positive Expectancy =====
 +
 +  * You may not make money on the trade right now, or even the next one, but if it makes money over the long run (has positive expectancy).
 +
 +  * You could have a system which is 35% accurate which still makes money (and a lot of it) over time.
 +
 +  * Get comfortable with uncertainty, and comfortable with losses (which are inevitable), then you will find yourself making good decisions more often than not.
 +
 +----
 +
 +===== Probability =====
 +
  
 <code> <code>
-Probability = Profitable Trades +                Profitable Trades 
-              ----------------- +probability =  ------------------- 
-              Total Trades +                 Total Trades 
 </code> </code>
  
Line 15: Line 32:
 <code> <code>
                  6                  6
-probability =  -----+probability =  -----   67
                  9                  9
 </code> </code>
 +
 +----
  
 What is the probability of winning for a future trade?  What is the probability of winning for a future trade? 
Line 26: Line 45:
  
 <code> <code>
-                (6+1)             +                (6+1)            
-probability =  -------    or   ------- +probability =  -------   or   ------- 
-                (9+1)           (9+1)+                (9+1)          (9+1)
 </code> </code>
  
Line 42: Line 61:
  
 <WRAP info> <WRAP info>
-**NOTE: This is slightly less than the original value of 6/9.+**NOTE**: This is slightly less than the original value of 6/9.
  
   * This method is called Laplace smoothing.    * This method is called Laplace smoothing. 
Line 49: Line 68:
  
  
 +----
 +
 +===== Smoothing using Weights =====
 +
 +<code c++>
 +double value=price[i+center], // Price value at the center.
 +       max=_Point;            // Maximum deviation.
 +
 +for(int j=0; j<period; j++)   //Calculate price deviations from the central one and the max deviation.
 +{
 +  weight[j]=MathAbs(value-price[i+j]);
 +  max=MathMax(max, weight[j]);
 +}
 +
 +double width=(period+1)*max/period,  // Correct the maximum deviation from the center so that there are no zeros at the ends.
 +sum=0,
 +denom=0;
 +
 +for(int j=0; j<period; j++)  // Calculate weight ratios for each price.
 +{
 +  if (Smoothing==Linear)  // Linear smoothing.
 +    weight[j]=1-weight[j]/width;
 +
 +  if (Smoothing==Quadratic)  // Quadratic smoothing.
 +    weight[j]=1-MathPow(weight[j]/width, 2);
 + 
 +  if (Smoothing==Exponential)  // Exponential smoothing.
 +    weight[j]=MathExp(-weight[j]/width);
 +
 +  sum=sum+weight[j]*price[i+j];
 +  denom=denom+weight[j];
 +}
 +
 +buffer[i]=sum/denom;  // Indicator value.
 +</code>
 +
 +----
 +
 +===== References =====
  
 +https://www.mql5.com/en/articles/11627
forex/probability.1671102583.txt.gz · Last modified: 2022/12/15 11:09 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki