Coding help - page 664

 

line 178 error: 'Close' - constant variable cannot be passed as reference


Files:
 
asaens15:

line 178 error: 'Close' - constant variable cannot be passed as reference


Check this thread : https://www.mql5.com/en/forum/175337 for correct versions (and original mql, not decompiled versions) of that indicator
 
Hello Everyone, please can any top coder code this strategy. Find attached a screenshot of the system.This system is designed solely for binary options but can be used in forex too. Now about the system: i am only taking trades from signals generated from the first and second sub windows indicators. the green and red lines show you a typical buy or sell signal when all conditions are met. for a
buy signal:
smfisher transform 3 must light blue,
renko maker arrow; GREEN and little box green,
Pcci must be above middle line
Solar wind of joy no-repaint: green
fisher non-repaint green
Files:
my system 2.PNG  33 kb
 

Dear friends,

Can you add "font size" value attached indi please?

Thank you... 

 

Mladen, I have questions. Is there a possibility to connect input value by this code:

main.cpp (adapter) 

#include "stdafx.h"
#include "NSNetwork.h"

extern "C" __declspec(dllexport) int __stdcall CalcNeuralNet(
                LPCWSTR dllPath_u, LPCWSTR weightsPath_u,
                double* inputs, double* outputs)
{       
    // Transform the lines from Unicode to normal ones
    CString dllPath     (dllPath_u);
    CString weightsPath (weightsPath_u);

    // Create neuronet
    NSRecallNetwork nn(dllPath);
    if (!nn.IsLoaded()) return (1);

    // Load balances
    if (nn.LoadWeights(weightsPath) != 0) return (2);
        
    // Pass input data and calculate the output
    if (nn.GetResponse(1, inputs, outputs) != 0) return (3);

    return 0;
}
AND CODE the advisor:
1. Here, the main question. Is it possible to replace the array of used (but in a file that has exported the value of candles somehow shifts the story of five bars in the past one line down). I think dll adapter itself is universal.
And then I would like to change the code advisor - both here boot array to the current price:
  a) replace the boot array of price indicators to linear sequence of several indicators and OHLC(do not know how many 30 -300, bars?).

  b) how much the last price values ​​and indicators, and how it should be connected to dock with used library files from Neurosolyutions

  с) construction of the predicted pattern of candles. but rather it is necessary to alter the adviser to the indicator... 

     p.s.  if you can fix the code to display the code - you can use any of the names of the indicators (sample 1, 2 ...).  It aims to build - line, the Сlosing price (column, which I chose for predictions)...


2. Another way out(best way): If it is rational - I ask you to share the sample (if you possess them) neural network indicator(NS), working with at least two indicators(for multiple) from MT4 
input double    Lots = 0.1;
//+------------------------------------------------------------------+
// Connect the DLL adapter, using which we are going to use the DLL neuronet created in NeuroSolutions
#import "NeuroSolutionsAdapter.dll"
int CalcNeuralNet(string dllPath, string weightsPath, double& inputs[], double& outputs[]);
#import 
//+------------------------------------------------------------------+
class CNeuroSolutionsNeuralNet
{
private:
   string dllPath;     // Path to a DLL neuronet created in NeuroSolutions
   string weightsPath; // Path to a file of the neuronet balances
public:
   double in[20]; // Neuronet inputs - OHLC of 5 bars
   double out[1]; // Neuronet outputs - Close of a current bar

   CNeuroSolutionsNeuralNet();
   bool Calc();
};
//+------------------------------------------------------------------+
void CNeuroSolutionsNeuralNet::CNeuroSolutionsNeuralNet()
{
   string terminal = TerminalInfoString(TERMINAL_PATH);
   dllPath     = terminal + "\\MQL5\\Files\\NeuroSolutions\\WeekPattern.dll";
   weightsPath = terminal + "\\MQL5\\Files\\NeuroSolutions\\WeekPattern.nsw";
}
//+------------------------------------------------------------------+
bool CNeuroSolutionsNeuralNet::Calc()
  {
   // Get current quotes for the neuronet
   MqlRates rates[], rate;
   CopyRates(Symbol(), Period(), 0, 6, rates);
   ArraySetAsSeries(rates, true);
      
   // Fill the array of input data of the neuronet
   double zlevel=0;   
   for (int bar=0; bar<=5; bar++)
     {
      rate = rates[bar];
      // 0 bar is not taken for input
      if (bar==0) zlevel=rate.open; // level of price calculation
      // 1-5 bars are inputed
      else
        {
         int i=(bar-1)*4; // input number
         in[i  ] = rate.open -zlevel;
         in[i+1] = rate.high -zlevel;
         in[i+2] = rate.low  -zlevel;
         in[i+3] = rate.close-zlevel;
        }
     }
 
   // Calculate the neuronet in the NeuroSolutions DLL (though the DLL adapter)
   int res = CalcNeuralNet(dllPath, weightsPath, in, out);
   switch (res)
     {
      case 1: Print("Error of creating neuronet from DLL \"", dllPath, "\""); return (false);
      case 2: Print("Error of loading balances to neuronet from the file \"", weightsPath, "\""); return (false);
      case 3: Print("Error of calculation of neuronet");  return (false);
     }
     
   // Output of the neuronet has appeared in the array out, you shouldn't do anything with it

   return (true);
  }
//+------------------------------------------------------------------+

CNeuroSolutionsNeuralNet NN;
double Prognoze;

//+------------------------------------------------------------------+
#include <Trade\Trade.mqh>
//+------------------------------------------------------------------+
void OnTick() 
  {
   // Get the price prediction from the neuronet
   if (NN.Calc()) Prognoze = NN.out[0];
   else           Prognoze = 0;

   // Perform necessary trade actions
   Trade();
  }
//+------------------------------------------------------------------+
void Trade() 
  {

   // Close an open position if it is opposite to the prediction

   if(PositionSelect(_Symbol)) 
     {
      long type=PositionGetInteger(POSITION_TYPE);
      bool close=false;
      if((type == POSITION_TYPE_BUY)  && (Prognoze <= 0)) close = true;
      if((type == POSITION_TYPE_SELL) && (Prognoze >= 0)) close = true;
      if(close) 
        {
         CTrade trade;
         trade.PositionClose(_Symbol);
        }
     }

   // If there is no positions, open one according to the prediction

   if((Prognoze!=0) && (!PositionSelect(_Symbol))) 
     {
      CTrade trade;
      if(Prognoze > 0) trade.Buy (Lots);
      if(Prognoze < 0) trade.Sell(Lots);
     }
  }
//+------------------------------------------------------------------+
 
kostumer27:

Mladen, I have questions. Is there a possibility to connect input value by this code:

main.cpp (adapter) 

1. Here, the main question. Is it possible to replace the array of used (but in a file that has exported the value of candles somehow shifts the story of five bars in the past one line down). I think dll adapter itself is universal.
And then I would like to change the code advisor - both here boot array to the current price:
  a) replace the boot array of price indicators to linear sequence of several indicators and OHLC(do not know how many 30 -300, bars?).

  b) how much the last price values ​​and indicators, and how it should be connected to dock with used library files from Neurosolyutions

  с) construction of the predicted pattern of candles. but rather it is necessary to alter the adviser to the indicator... 

     p.s.  if you can fix the code to display the code - you can use any of the names of the indicators (sample 1, 2 ...).  It aims to build - line, the Сlosing price (column, which I chose for predictions)...


2. Another way out(best way): If it is rational - I ask you to share the sample (if you possess them) neural network indicator, working with at least two indicators(for multiple) from MT4 

Sorry, I am not familiar with NeuroSolutions so I can not help in this matter

 

Hello Mladen, please is it possible to delay the signal of an indicator to a personally defined time. For example, i have an arrow indicator that sometimes shows up arrows from the beginning of a candle on a 30 minute chart on the current candle, but i want to disregard such signals because they most times tend to repaint/disappear. I would prefer if i there is an indicator/script or if it is possible to adjust the indicator itself to start showing signals at a particular set time. eg 10 mins/30mins chart, 20mins/1hour etc.

Thanks in advance. 

 
emmany4:

Hello Mladen, please is it possible to delay the signal of an indicator to a personally defined time. For example, i have an arrow indicator that sometimes shows up arrows from the beginning of a candle on a 30 minute chart on the current candle, but i want to disregard such signals because they most times tend to repaint/disappear. I would prefer if i there is an indicator/script or if it is possible to adjust the indicator itself to start showing signals at a particular set time. eg 10 mins/30mins chart, 20mins/1hour etc.

Thanks in advance. 

It can not be done for any signal that is on a closed bar

Even on an opened bar it is doubtful for what time delay it can be done (in some cases it would not work)

 
kostumer27:

Mladen, I have questions. Is there a possibility to connect input value by this code:

main.cpp (adapter) 

1. Here, the main question. Is it possible to replace the array of used (but in a file that has exported the value of candles somehow shifts the story of five bars in the past one line down). I think dll adapter itself is universal.
And then I would like to change the code advisor - both here boot array to the current price:
  a) replace the boot array of price indicators to linear sequence of several indicators and OHLC(do not know how many 30 -300, bars?).

  b) how much the last price values ​​and indicators, and how it should be connected to dock with used library files from Neurosolyutions

  с) construction of the predicted pattern of candles. but rather it is necessary to alter the adviser to the indicator... 

     p.s.  if you can fix the code to display the code - you can use any of the names of the indicators (sample 1, 2 ...).  It aims to build - line, the Сlosing price (column, which I chose for predictions)...


2. Another way out(best way): If it is rational - I ask you to share the sample (if you possess them) neural network indicator(NS), working with at least two indicators(for multiple) from MT4 
If you have a legal Neurosolutions it should work
 
mladen:

This is the part that handles the entries


Dear mladen,

Can you please help me incorporate a strategy to help ride the momentum of retracement/pullbacks/reversals/bounce back in short-time frames by modifying your 3 MA cross with aert mtf 3.03 ?

When 3 MA cross-over happens and the candle size exceeds the pips input by the user, the indicator is highlighted by bright color and bars ago number (to know the latest time of cross-over action) is printed on the candle and same way the candle is highlighted and bars ago number is printed when the bounce-back happens and the price crosses the middle MA.

I have been eagerly looking forward to your multicurrency MTF heatmap on MA crossovers. Hope you find time for it.

Thank you.

Reason: