Discussion of article "Experiments with neural networks (Part 6): Perceptron as a self-sufficient tool for price forecast"

 

New article Experiments with neural networks (Part 6): Perceptron as a self-sufficient tool for price forecast has been published:

The article provides an example of using a perceptron as a self-sufficient price prediction tool by showcasing general concepts and the simplest ready-made Expert Advisor followed by the results of its optimization.

Indicators are mathematical equations used to analyze the market and help identify trends, entry and exit points, as well as support and resistance levels. Some of the most common indicators that can be used in the perceptron to analyze the Forex market include:

  • Moving Average;
  • Relative Strength Index (RSI);
  • Stochastic Oscillator;
  • MACD (Moving Average Convergence Divergence).


Passing the closing price and indicators to the perceptron allows the model to take into account various aspects of market analysis and create more accurate price predictions. For example, a model might use a moving average to determine the overall market trend and then use a stochastic oscillator to determine a market entry point.

Author: Roman Poshtar

 

Hi Roman,

Two Great articles! I have just read both for the first time.  

As I have not studied the code yet, I am interested to know is the CNeuralNet object a reformulation of your previous Perceptron calculations?  It looks very interesting as the the initial Angle and fan approaches fail miserably in my forward tests.  I am using EURUSD H4 from 1/1/2020 to 1/1/0203 as my training and using 1/1/2023 to 5/1/2023 as my forward tests.  The angle fails as there are extended trends with pauses that trigger it but do not reverse and stop out and bankrupt the account with the first dip around 1/2/2023 whereas your tests follow this dip perfectly.  The fan approach does not take any trades in the forward test.


Stay safeI', I'm looking forward to your next articles.


CapeCoddah

P.S.

I have just looked at your two source files and have some questions. 

It seems like there are missing parts based on source codes from your prior Perceptron articles. 

The EA provided seems to be your Optimization EA. However, it does not use the CNeuralNet object which I expected to see. 

The forward test EA is missing as the Attached EA does not use the results from the GA optimization run as input for the weights array, e.g. the EURUSD array.

Or dis I miss a a logical change in your Perceptron philosophy?

 
CapeCoddah #:

Hi Roman,

Two Great articles! I have just read both for the first time.  

As I have not studied the code yet, I am interested to know is the CNeuralNet object a reformulation of your previous Perceptron calculations?  It looks very interesting as the the initial Angle and fan approaches fail miserably in my forward tests.  I am using EURUSD H4 from 1/1/2020 to 1/1/0203 as my training and using 1/1/2023 to 5/1/2023 as my forward tests.  The angle fails as there are extended trends with pauses that trigger it but do not reverse and stop out and bankrupt the account with the first dip around 1/2/2023 whereas your tests follow this dip perfectly.  The fan approach does not take any trades in the forward test.


Stay safeI', I'm looking forward to your next articles.


CapeCoddah

P.S.

I have just looked at your two source files and have some questions. 

It seems like there are missing parts based on source codes from your prior Perceptron articles. 

The EA provided seems to be your Optimization EA. However, it does not use the CNeuralNet object which I expected to see. 

The forward test EA is missing as the Attached EA does not use the results from the GA optimization run as input for the weights array, e.g. the EURUSD array.

Or dis I miss a a logical change in your Perceptron philosophy?

Hello, my friend. I do not understand you well, so I ask you to express your thoughts gradually. Optimization depends on the depth of influence of the perceptron used in the settings. Each pair has its own conclusions. It also depends on the number of passes, since their value is infinite.

 

Hi Roman,

I appreciate the speedy response.  I think I understand GA optimization in that the results may vary from run to run using identical time frames, & that the results will be different depending on the starting date, length of test and for each pair.  What I did not expect is that when a 3 year training run produces a 50% profit, that the EA will fail in 5 days by losing the whole starting position or not take any trades during the actual run. 

My ultimate objective is to develop a swing trading Perceptron EA that is trained for a fixed length and runs for only one month following the last date of the training period.  It would then be retrained for the same length but the startling period would be one month later, followed by running for the second month for actual data, like a rolling  SMA. My basis for this is my assumption that the Forex market gradually changes direction and that any "trained" Network will be most accurate in the first few months following training and then will gradually lose accuracy as the market conditions continue to change.  I also understand that there can be seminal market changes will have a direct impact on the accuracy of any "trained" network.  This type of change will significantly impact all future changes.

It is my observation that the Angle Perceptron is quite good at sensing the beginning of reversals before they happen.  Unfortunately, it also good at detecting pauses in trends and issuing a trade in anticipation of the reversal which in this case does not happen.  As the trend continues, this leads to a significant loss due to the large SL which at the beginning of the actual test run causes the loss of the starting position.  I think part of the problem is that 100 Perceptron loop requires adaptive adjustment to lower the total number of trades based on the account balance. 

My immediate issues are from the P.S. to my original comment.
In your former posts, you posted an EA for optimization (opt) and a second EA for trade testing (trade).  In this post, there is only one: EA Perceptron_MA_4.  It is my sense that this EA can be used to run GA optimizations directly corresponding to your earlier OPT versions.  But, there is no Trade version included for forward testing.  If this is intentional, I can adapt this EA to load the GA results to produce an EA for forward testing.

In addition to the EA, you posted a class object, NeualNet as an include file, which I have not reviewed.  What surprised me was the Perceptron_MA_4 EA does not use this include file.  What I had expected was that there would be an optimizing EA version that included the CNeuralNet class and also used one of the Normalizing techniques from your Part 5 posting. And in addition there would be a separate Trade version for forward testing.  I think the creation of the class objects a very good direction to take.  As an object, it becomes very easy to use multiple different Perceptrons at the same time in an EA, say for trades, stop loss or take profit settings or possibly to even create an adaptive trading strategy using alternative strategies for trending of flat market.  Any yes, I know that multiple objects will be processing hogs for training.

 
CapeCoddah #:

Hi Roman,

I appreciate the speedy response.  I think I understand GA optimization in that the results may vary from run to run using identical time frames, & that the results will be different depending on the starting date, length of test and for each pair.  What I did not expect is that when a 3 year training run produces a 50% profit, that the EA will fail in 5 days by losing the whole starting position or not take any trades during the actual run. 

My ultimate objective is to develop a swing trading Perceptron EA that is trained for a fixed length and runs for only one month following the last date of the training period.  It would then be retrained for the same length but the startling period would be one month later, followed by running for the second month for actual data, like a rolling  SMA. My basis for this is my assumption that the Forex market gradually changes direction and that any "trained" Network will be most accurate in the first few months following training and then will gradually lose accuracy as the market conditions continue to change.  I also understand that there can be seminal market changes will have a direct impact on the accuracy of any "trained" network.  This type of change will significantly impact all future changes.

It is my observation that the Angle Perceptron is quite good at sensing the beginning of reversals before they happen.  Unfortunately, it also good at detecting pauses in trends and issuing a trade in anticipation of the reversal which in this case does not happen.  As the trend continues, this leads to a significant loss due to the large SL which at the beginning of the actual test run causes the loss of the starting position.  I think part of the problem is that 100 Perceptron loop requires adaptive adjustment to lower the total number of trades based on the account balance. 

My immediate issues are from the P.S. to my original comment.
In your former posts, you posted an EA for optimization (opt) and a second EA for trade testing (trade).  In this post, there is only one: EA Perceptron_MA_4.  It is my sense that this EA can be used to run GA optimizations directly corresponding to your earlier OPT versions.  But, there is no Trade version included for forward testing.  If this is intentional, I can adapt this EA to load the GA results to produce an EA for forward testing.

In addition to the EA, you posted a class object, NeualNet as an include file, which I have not reviewed.  What surprised me was the Perceptron_MA_4 EA does not use this include file.  What I had expected was that there would be an optimizing EA version that included the CNeuralNet class and also used one of the Normalizing techniques from your Part 5 posting. And in addition there would be a separate Trade version for forward testing.  I think the creation of the class objects a very good direction to take.  As an object, it becomes very easy to use multiple different Perceptrons at the same time in an EA, say for trades, stop loss or take profit settings or possibly to even create an adaptive trading strategy using alternative strategies for trending of flat market.  Any yes, I know that multiple objects will be processing hogs for training.

Hi. You have the right direction. If you need help with a specific task, write to me and I will try to help. Just write in private.

Reason: