Idea by: Igor
Code by: barabashkakvn
Let’s dive into the Peceptron_Mult Expert Advisor (EA) designed for MetaTrader 5! This versatile EA operates on three currency pairs simultaneously: EUR/USD (Symbol #1), GBP/JPY (Symbol #2), and AUD/NZD (Symbol #3). It employs a simple yet effective neural network, known as a perceptron, which leverages the iAC (Acceleration/Deceleration, Accelerator/Decelerator Oscillator).
If you want to optimize your trading strategy, you can easily disable certain symbols by assigning a non-existing symbol to the variable Symbol #.
Setting Position Sizes
One unique feature of this EA is how it determines position sizes. You can specify the minimum number of lots in the variables labeled Number of minimum lots for Symbol #. For instance, let’s say the minimum lot size is 0.1 for Symbol #1 and 0.01 for Symbol #2. If you set the Number of minimum lots for Symbol # as 10 for both symbols, it will open a position of 1.0 lots (0.1 x 10) for Symbol #1 and 0.10 lots (0.01 x 10) for Symbol #2.
Understanding the Perceptron Block
Every time a new bar forms (when a new bar appears for all the symbols in play), the perceptron block receives an array of indicator values (array) for each symbol. Here’s a quick look at how it works:
//+------------------------------------------------------------------+ //| Perceptron | //+------------------------------------------------------------------+ double Perceptron(double &array[],int y1,int y2,int y3,int y4) { double w1 = y1 - 100; double w2 = y2 - 100; double w3 = y3 - 100; double w4 = y4 - 100; double a1 = array[0]; double a2 = array[7]; double a3 = array[14]; double a4 = array[21]; return(w1 * a1 + w2 * a2 + w3 * a3 + w4 * a4); }
For best results, I suggest optimizing each symbol one at a time. Start with Symbol #1 while disabling Symbol #2 and Symbol #3. Set your parameters within a range from 0 to 100, and choose your Stop Loss (SL) and Take Profit (TP) levels based on your strategy. Remember, to disable a symbol, simply assign the variable Symbol # to a non-existent symbol.
Comments 0