Discussion of article "Using MetaTrader 5 Indicators with ENCOG Machine Learning Framework for Timeseries Prediction" - page 4

 

Have anyone made money using this Neural net Expert Advisor?

 

Would like to see this translated into Encog 3.1; since I am having issues with the original version on Norwegian platform.

On 3.1 I am not sure how to do the time boxing, and when skipping this step, the network does not seem to produce the final


            // Step 2: Normalize
            Console.WriteLine("Step 2: Create Future Indicators");

            var analyst = new EncogAnalyst();
            var wizard = new AnalystWizard(analyst);
            wizard.Wizard(new System.IO.FileInfo(STEP2_FILENAME), true, AnalystFileFormat.DecpntComma);
            analyst.Script.Normalize.NormalizedFields[0].MakePassThrough();      //Is this needed?
            analyst.Script.Normalize.NormalizedFields[1].MakePassThrough();
            var norm = new AnalystNormalizeCSV();
            norm.Analyze(new System.IO.FileInfo(STEP2_FILENAME), true, CSVFormat.English, analyst);
            norm.ProduceOutputHeaders = true;

            norm.Normalize(new System.IO.FileInfo(STEP4_FILENAME));

// STEP 3 omitted since I dont know how to time box in 3.1. It says Optional in the original sample.

            Console.WriteLine("Step 4: Train");
            Console.ReadKey();
            INeuralDataSet training = (BasicNeuralDataSet)EncogUtility.LoadCSV2Memory(STEP4_FILENAME, 3 + externalIndicatorCount,   // I cannot find well documented what the input count and ideal count should be. Identical?
                                                                                      3 + externalIndicatorCount, true, CSVFormat.English, true);
            BasicNetwork network = new BasicNetwork();
            network.AddLayer(new BasicLayer(new ActivationTANH(), true, inputNeurons));
            network.AddLayer(new BasicLayer(new ActivationTANH(), true, HIDDEN1_NEURONS));
            network.AddLayer(new BasicLayer(new ActivationLinear(), true, outputNeurons));
            network.Structure.FinalizeStructure();
            network.Reset();
            // train the neural network
            EncogUtility.TrainConsole(network, training, 3);
            Console.WriteLine(@"Training complete, saving network.");  // It never gets here, so obviously somethingis wrong
            EncogDirectoryPersistence.SaveObject(new System.IO.FileInfo(STEP5_FILENAME), network);
      

As it stands (in the original sample/version) I have my first problem in the ind.Process line, where the produced file has 3 columns only. The Analyze step seem to be picking up the file correctly with all 6 columns, but the produced file should have 7 columns. When setting Country settings to US(English) the produced file is OK, but this is not my normal config and gives me some other issues I would like to avoid.


            ProcessIndicators ind = new ProcessIndicators();
            ind.Analyze(STEP1_FILENAME, true, CSVFormat.DECIMAL_POINT);
            int externalIndicatorCount = ind.Columns.Count - 3;
            ind.AddColumn(new BestReturn(RESULT_WINDOW,true)); 
            ind.Process(STEP2_FILENAME);    
 

Hi,

I have eventually worked our where to put the dlls, got the script and indicator to work but not the ea.

My Intel  i7 core 1st generation wants to access OpenCL for multicore computing which I don't seem to have therefore the ea doesn't want to know.

I transferred all this to my Intel i7 core 2nd generation laptop and now it wants my EncogNNTrainDLL.dll in the 64 bit version! 

I have scoured the internet for this but don't seem to be able to put my hands on it - anybody have any ideas?

Brilliant article by the way, I have always been interested in neural nets - right from the days when computer memory was measured in kilobytes.

Love Jeff Heaton's videos - well worth watching. 

Thank you for that - Rewop 

 

Hi Ivesteo, 

Good article, thanks!

May I know what type of training you're using? Are you using SOM, or FeedForward Network. I'm not really clear what is the Ideal data you're using.

Thanks,

HyperPro. 

 

What is RESULT_WINDOW . Do I understand correctly, these are bars that are supplied only during network training ? After all, there is nowhere to take the bars of the future when working

/// The number of future bars used.
        /// </summary> 

public const int RESULT_WINDOW = 5;

// The number of forward bars used to get the best result.

        /// </summary>
        public const int RESULT_WINDOW = 5;

 

Great article.  I'm a very appreciative C# developer. 

I followed your previous article on getting Unmanaged DLL to talk to .NET application. I then used managed pipes to allow my C# wrapped code to talk to a .NET web-application with WCF. 

I plan to back it onto a SQL Database with reporting and remote order management of the EA. The next step is to plugin some Neural Network code and start testing. 

Thanks again, these are some of the best articles I have read recently. 

 

something abruptly ended the discussion...

Does anyone work with this library? Is it worth studying it?

I really liked the article. Respect to the author!

 

Hi guys,

I try to port this article to encog v.3.2 but I have problem with step3 time-boxes. Is someone able to do step 3?


 // Step 1: Create future indicators
            Console.WriteLine("Step 1: Analyze MT5 Export & Create Future Indicators");
            ProcessIndicators ind = new ProcessIndicators();
            ind.Analyze(new FileInfo(STEP1_FILENAME), true, CSVFormat.DecimalPoint);
            int externalIndicatorCount = ind.Columns.Count - 3;
            ind.AddColumn(new BestReturn(RESULT_WINDOW, true));
            ind.Process(new FileInfo(STEP2_FILENAME));
            Console.WriteLine("External indicators found: " + externalIndicatorCount);

            // Step 2: Normalize
            Console.WriteLine("Step 2: Create Future Indicators");
            var analyst = new EncogAnalyst();
            var wizard = new AnalystWizard(analyst);
            wizard.Goal = AnalystGoal.Classification;
            wizard.Wizard(new System.IO.FileInfo(STEP2_FILENAME), true, AnalystFileFormat.DecpntComma);
            analyst.Script.Normalize.NormalizedFields[0].MakePassThrough();      //Is this needed?
            analyst.Script.Normalize.NormalizedFields[1].MakePassThrough();

            var norm = new AnalystNormalizeCSV();
            norm.ExpectInputHeaders = true;
            norm.Format = CSVFormat.English;
            norm.Analyze(new FileInfo(STEP2_FILENAME), true, CSVFormat.English, analyst);
            norm.ProduceOutputHeaders = true;

            norm.Normalize(new FileInfo(STEP3_FILENAME));


            Console.WriteLine("Step 3: Time-boxses");
            // neuron counts
            int inputNeurons = INPUT_WINDOW * externalIndicatorCount;
            int outputNeurons = PREDICT_WINDOW;

            FileInfo rawFile = new FileInfo(STEP3_FILENAME);


               //Step 3 

                HOW???
            
            Console.WriteLine("Step 4: Train");
            IMLDataSet training = (IMLDataSet)EncogUtility.LoadCSV2Memory(STEP4_FILENAME, inputNeurons,
                                                                                     outputNeurons, true, CSVFormat.English,false);
            

            BasicNetwork network = new BasicNetwork();
            network.AddLayer(new BasicLayer(new ActivationTANH(), true, inputNeurons));
            network.AddLayer(new BasicLayer(new ActivationTANH(), true, HIDDEN1_NEURONS));
            network.AddLayer(new BasicLayer(new ActivationLinear(), true, outputNeurons));
            network.Structure.FinalizeStructure();
            network.Reset();

            //EncogUtility.TrainToError(network, training, TARGET_ERROR);
            EncogUtility.TrainConsole(network, training, 3);
            Console.WriteLine(@"Training complete, saving network.");  // It never gets here, so obviously somethingis wrong
            EncogDirectoryPersistence.SaveObject(new System.IO.FileInfo(STEP5_FILENAME), network);
 

Hi,

I am also trying to port all the necessary stuff up to version 3.2. I see no other way because the version 2.6 is not available on the net. But it seems to be a ride through the jungle. I am yet working for about 4 weeks. But I cannot see the end.

Did anybody succeed in porting? Can anybody help.

Thank you very much.

refltr 

 
i have succeded porting this thread with encog 3.3 and using mt4. but i havent done yet with expert advisor. just pm me if you need help at porting