steps on nn ...
This commit is contained in:
@@ -24,11 +24,41 @@
|
|||||||
// Imports ...
|
// Imports ...
|
||||||
|
|
||||||
//
|
//
|
||||||
|
#include <Arrays/ArrayObj.mqh>
|
||||||
#include "../Classes/x-saherelm.x121.setup.class.mq5"
|
#include "../Classes/x-saherelm.x121.setup.class.mq5"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Definitions ...
|
// Definitions ...
|
||||||
|
|
||||||
|
//
|
||||||
|
class X121SetupCycleScoreTracker : public XSCBase
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// Public ...
|
||||||
|
public:
|
||||||
|
//
|
||||||
|
// Define Bullish and Bearish Score ...
|
||||||
|
CArrayObj bullishScore;
|
||||||
|
CArrayObj bearishScore;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Tools ...
|
||||||
|
void AddScores(
|
||||||
|
double bullScore,
|
||||||
|
double bearScore //
|
||||||
|
) {
|
||||||
|
//
|
||||||
|
// bullishScore
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Protected ...
|
||||||
|
protected:
|
||||||
|
//
|
||||||
|
// Private ...
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
// Inputs ...
|
// Inputs ...
|
||||||
struct X121SetupCycleInputs
|
struct X121SetupCycleInputs
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
# Concepts of a Neural Network (NN)
|
||||||
|
|
||||||
|
simulation of human nervous system in its ability to learn and adpt.
|
||||||
|
|
||||||
|
## Units
|
||||||
|
|
||||||
|
1. Inputs
|
||||||
|
2. Weights
|
||||||
|
3. Transfer Function + net output
|
||||||
|
4. Activation Function
|
||||||
|
5. Outputs
|
||||||
|
|
||||||
|
### Flow
|
||||||
|
|
||||||
|
1. Update and Provide our Inputs;
|
||||||
|
2. Transfer Function;
|
||||||
|
3. Net OutPut (Inputs and Weights);
|
||||||
|
4. Actiation Function;
|
||||||
|
5. Calculate Output;
|
||||||
|
|
||||||
|
### Learnign
|
||||||
|
|
||||||
|
it is a process to Change Weights of inputs based on results ...
|
||||||
|
this happens to algorithm improve itself optimization ...
|
||||||
|
|
||||||
|
### Net
|
||||||
|
|
||||||
|
in this process Inputs and their Weights collecting together.
|
||||||
|
|
||||||
|
### Activation Function
|
||||||
|
|
||||||
|
Recieved Net Inputs (Weighted Inputs) and then Calculate output based on them.
|
||||||
|
|
||||||
|
## Multi Layer NN
|
||||||
|
|
||||||
|
1. Input Layer;
|
||||||
|
2. Hidden Layer;
|
||||||
|
3. Output Layer;
|
||||||
|
|
||||||
|
Hidden Layers recieved Data from all other layers at the end, then Populate as a Neuron.
|
||||||
|
|
||||||
|
### Input Data Normalization
|
||||||
|
|
||||||
|
a Process where all the input data normalized.
|
||||||
|
reduce data to an accepted ranges.
|
||||||
|
i.e. [0,1] or [-1, 1].
|
||||||
|
|
||||||
|
this peocess so important for us for making data more acceptable.
|
||||||
|
|
||||||
|
this can done by some standard form:
|
||||||
|
|
||||||
|
y = x - (x(min) * (d2 -d1)) / x(max - x(min)) + d1
|
||||||
|
|
||||||
|
x => value to normalized;
|
||||||
|
x(min)/x(max) => x Value range max and min;
|
||||||
|
d1,d2 => ranges to upper and lower normalization;
|
||||||
|
|
||||||
|
### Activation Functions
|
||||||
|
|
||||||
|
a function which calculate the output of a neuron.
|
||||||
|
it recieved a Net Input (Weighted functions);
|
||||||
|
|
||||||
|
1. Unit Step / Hard Threshold Functions;
|
||||||
|
2. Sigmoid Function;
|
||||||
|
3. Hyperbolic Tangent Function;
|
||||||
|
|
||||||
|
## Unti Step
|
||||||
|
|
||||||
|
a Graph by y axix Output and x axix Net Input and values in y between 0, 1 and x is 0 to TETA or threshold.
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
///////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// SaherElm IT Center XNNTest MQL5 Expert Advisor
|
||||||
|
// -------------------------------------------------
|
||||||
|
// Name: XNNTest
|
||||||
|
// Description: an Exper Advisor which used RSI and MA
|
||||||
|
// to Analyse Market ...
|
||||||
|
//
|
||||||
|
// Maintainer:
|
||||||
|
// ------------
|
||||||
|
// Hadi Khazaee Asl (hadi_khazaee_asl@yahoo.com)
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////x
|
||||||
|
//
|
||||||
|
// Global Properties ...
|
||||||
|
#property copyright "Copyright 2023, SaherElm IT Center"
|
||||||
|
#property link "https://saherelm.ir"
|
||||||
|
#property version "1.00"
|
||||||
|
#property description "SaherElm XNNTest"
|
||||||
|
#property strict
|
||||||
|
|
||||||
|
//
|
||||||
|
#include "../Classes/x-saherelm.xczone.class.mq5"
|
||||||
|
|
||||||
|
//
|
||||||
|
#define ShortName "XNNTest"
|
||||||
|
|
||||||
|
//
|
||||||
|
// Inputs ...
|
||||||
|
|
||||||
|
//
|
||||||
|
// Variables ...
|
||||||
|
int barsTotal;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Initialization ...
|
||||||
|
int OnInit()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
if (!InitialEA())
|
||||||
|
{
|
||||||
|
return INIT_PARAMETERS_INCORRECT;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Init Succeed ...
|
||||||
|
return INIT_SUCCEEDED;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// DeInitialization ...
|
||||||
|
void OnDeinit(const int reason)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
// REASON_PROGRAM 0 The EA has stopped working calling the ExpertRemove() function
|
||||||
|
// REASON_REMOVE 1 Program removed from a chart
|
||||||
|
// REASON_RECOMPILE 2 Program recompiled
|
||||||
|
// REASON_CHARTCHANGE 3 A symbol or a chart period is changed
|
||||||
|
// REASON_CHARTCLOSE 4 Chart closed
|
||||||
|
// REASON_PARAMETERS 5 Inputs changed by a user
|
||||||
|
// REASON_ACCOUNT 6 Another account has been activated or reconnection to the trade server has occurred due to changes in the account settings
|
||||||
|
// REASON_TEMPLATE 7 Another chart template applied
|
||||||
|
// REASON_INITFAILED 8 The OnInit() handler returned a non-zero value
|
||||||
|
// REASON_CLOSE 9 Terminal closed
|
||||||
|
|
||||||
|
//
|
||||||
|
// De Initialize XSampleEA Providers ...
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// On Tick Handler ...
|
||||||
|
void OnTick()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
int bars = iBars(
|
||||||
|
_Symbol,
|
||||||
|
_Period //
|
||||||
|
);
|
||||||
|
if (barsTotal == bars)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
barsTotal = bars;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
bool InitialEA()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
|
//
|
||||||
|
result = true;
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
@@ -59,7 +59,7 @@ input bool x121EAUseGrid = true; // Use Grid Signals
|
|||||||
input double x121EAGridDistance = 50; // Grid Distance
|
input double x121EAGridDistance = 50; // Grid Distance
|
||||||
input double x121EAGridVolumeMultiplier = 2; // Grid Volume Multiplier
|
input double x121EAGridVolumeMultiplier = 2; // Grid Volume Multiplier
|
||||||
input double x121EAMinRequiredProfitPerTrade = 1; // Minimum Required Profit for Hedging
|
input double x121EAMinRequiredProfitPerTrade = 1; // Minimum Required Profit for Hedging
|
||||||
input double x121EAMinRequiredProfitPerVolumeFactor = 0.1; // Minimum Required Profit for Hedging Per Velume
|
input double x121EAMinRequiredProfitPerVolumeFactor = 0.1; // Minimum Required Profit for Hedging Per Volume
|
||||||
input int x121EARestingAfterHedge = 0; // Resting Seconds After Hedge
|
input int x121EARestingAfterHedge = 0; // Resting Seconds After Hedge
|
||||||
input int x121EACloseOnSpecificTime = -1; // Close All Trades in Specific Time
|
input int x121EACloseOnSpecificTime = -1; // Close All Trades in Specific Time
|
||||||
input bool x121EACloseOnOpposit = false; // Close all Positions on Opposit
|
input bool x121EACloseOnOpposit = false; // Close all Positions on Opposit
|
||||||
|
|||||||
Reference in New Issue
Block a user