CORRELATION FORMULA EA main note: THE SYSTEM SHOULD BE BASED ON THE SOUL OF THE PREVIOUS EA ALREADY STUDIED. Important: Definition of order set: the EA opens and closes two currency pairs each time, that is: it must not open or close only one currency pair, it has to open and close in both so that there are no orders without its counterpart : by the Average system explained below, can be more than two orders opened in the same set of operations, each order of this set must have the same magic number different from that of other sets, just as the current EA of Correlations already operates studied. General description: The EA must calculate the correlation between two pairs of currencies, in two different time periods at the same time, a longer time span called "Base" and a much smaller time span called "Actual", these calculations will make them with the formula explained in the following link: https://www.investopedia.com/terms/c/correlationcoefficient.asp. After calculating the correlation in both time lapses, he compares them permanently to see what is the difference between them; if the difference is sufficient as configured in the SET of the EA then it will open two initial orders. For example: The EA calculates the correlation that exists between two currency pairs during the last 600 candles in the H1 period (this would be the "Base Correlation"), at the same time the EA calculates the correlation that exists between the same currency pairs but during the last 24 candles in the H1 period. After it has these two data, it must take in count the following: The correlations are calculated from 1 to -1 (see: https://www.investopedia.com/terms/c/correlationcoefficient.asp) (see: https://en.wikipedia.org/wiki/Correlation_coefficient) 1) if the result of the "Base Correlation" is equal to or greater than a factor X (usually 0.80), the pairs will be considered positively correlated, it will be a "Positive Correlation". 2) if the result of the "Base Correlation" is equal to or less than a factor -X (usually -0.80), the pairs will be considered negatively correlated, it will be a "Negative Correlation". 3) if there is a Positive Correlation and the "Current Correlation" has a difference of Y (generally 0.50) with respect to the "Base Correlation", the EA will open the two initial orders, one order will be BUY and the other order will be SELL, This will be determined by the prices shown in the "Overlay" indicator, the top price is sold and the lower price is bought. 4) if there is a Negative Correlation and the "Current Correlation" has a difference of -Y (generally -0.50) with respect to the "Base Correlation", the EA will open the two initial orders, both BUY orders or both SELL orders , I do not know how to determine if it is bought or sold, please present solutions. Note: when there is a correlation between two pairs of currencies in the base period, it will be shown in light green, if there is no correlation it will be shown in orange. OVERLAY INDICATOR: The Overlay indicator should make this overlap starting the span of time determined by the base span, in the example we have been using: the indicator would superimpose the two graphs on the H1 timefram starting 600 candles behind. note: if the programmer comes up with a better way to determine which pair should be bought and which pair should be sold please raise it and we will see if it is possible to implement it or not. Attention: CALCULATION OF LOTS: the lots with which the EA must open each order, must be calculated so that the pips of each order are worth the same, so when any of the orders go up or down always do so in the same measure of profit or losses. For example: 1 pip of eur-usd is worth 10 usd with each Lot that has the order, but a pip of usd-jpy is worth less (I do not remember how much) then the order of the usd-jpy should have a little more lots than the eur- usd, so when either of you move, win or lose the same. SYSTEM CALLED "AVERAGE": The "Average" system is a system that opens new operations every certain amount of money at a loss; the new operations are equal to the first ones and the losses are calculated by group of operations with the same magic number. For example: suppose that the EA opens an order of eur-usd of 2 lots and an order of usd-jpy of 2.4 lots and we have configured the Average System so that it opens new orders every 2,500 usd with a multiplication factor of 1.5; this means that when the set of orders formed by eur-usd and usd-jpy reach 2,500 usd of loss they will open another 2 new orders with 3 lots for eur-usd (2 x 1.5 = 3.0), but to know how many lots of usd-jpy should be based on the rule of making the pips of both orders worth the same. This will then be repeated when the set loses 5,000, 7,500, 10,000, 12,500 ... ... CLOSE OF OPERATIONS: Given the nature of the entire system, the EA should never close operations in negative, unless it is clear that it runs out of margin; You can only close positive operations in the following ways: TP1: must be in% of the Balance or in the base currency of the account and will indicate the amount of money to be reached so that the first two open orders are closed. TP2: must be in% of the Balance or in the base currency of the account and will indicate the amount of money to be reached among all the orders of a set of operations (with the same magic number) so that all of them are closed at the same time. TPGlobal: must be in% of the Balance or in the base currency of the account and will indicate the amount of money to be reached among all the open orders, no matter what magic number they have, so that absolutely all of them are closed. AVERAGE: must be in% of the Balance or in the base currency of the account and will indicate the amount of money that a set of orders must be losing for this system to open new orders. OTHER PARAMETERS AND BUTTONS: START BUTTON: this button will be in the Panel or Dashboard and will be required for the EA to start operating, if this button is not pressed then the EA does not start; this button is deactivated each time you change the settings of the set. CLOSE BUTTON: the panel should show how much one group of orders are winning or losing a set of orders (with the same magic number) and with this button we can close the whole set of orders if we want. MILISECONDS: it will indicate every few milliseconds the Ea will do its correlation calculations. MinDISTANCE: filter, it will indicate the minimum distance in points that there must be between the two prices, indicated by the OVERLAY indicator. TEST-MODE: this option will allow you to test in backtest without the need to press the START button. MULTIPLIER: multiplying factor with which the Average system will work. note: this factor only multiplies one of the two logs, the other must be calculated so that the pips have the same value. MM: - fix lots: -% of Balance: Comments: the EA must indicate the magic number of the group in the comment rengon. ATTENTION: WE NEED TO PUT AN ACCOUNT LIMIT AND A DATE LIMIT, THIS SHOULD BE TAUGHT HOW, HOWEVER YOU NEED A FREE DEMO TO PROVE IT WITHOUT HAVING TO CONFIRM DATE LIMITS OR ACCOUN