Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1021

 

Set a fixed spread in the tester. Generally speaking, EAs sensitive to such things - down the toilet )

 
Yes, that's right, thank you very much. About the EA, I don't know. The author is just presenting the sensitivity of the EA as its main advantage. Because he describes that the Expert Advisor is not indicator based, but based on price movement. That is why he recommends to work on ecn accounts, and quotes from dukascopi. What do you think about it?
 
Lians:
Hello, Dear Professionals.

There is a script to export quotes in the format I want for the last 100 bars or up to a certain time in the past. It works as it should. But if it is thrown on the visualization chart of the tester, it saves quotes based on the last time there is a quote in the history, not on the date and time of the tester.

Can you teach it to save the last 100 bars based on the time of the tester's visualization chart?

If so, please advise how to do it. I can't figure it out.
PS: the fact that it uses Kim's function for replacement, instead of StringReplace - that's how it's designed, don't pay attention.


I will reply to myself. If I make an indicator out of this script, it works properly for some reason.
So a solution has been found. Although a couple of clicks less convenient, but still better than nothing.
 

indicator - ATS (Alpha Trend Spotter Price Action free)

CandleHigh=High[Highest(NULL, 0,2,3,i)];
CandleLowS=Low[Lowest(NULL,0,1,3,i)];
CandleOpenS=Open[i];
CandleHighF=High[Highest(NULL, 0, 2, 3, (i+3))];
CandleHighL=Low[Lowest(NULL,0,1,3,(i+3))];
CandleOpenL=Open[i+3];
//---
if((CandleHigh>CandleHighF) && (CandleOpenS<CandleHighL))
{
BufferMap1[i]=High[i+3]+0.0010;
}
//---
if((CandleLowS<CandleHighL) && (CandleOpenS>CandleHighF))
{
BufferMap2[i]=Low[i+3]-0.0010;

questions:

1. How many candlesticks are analyzed?
2. On which candlestick is the arrow placed?
3.
like O1>C2

this is code for mq5 of the same indicator

{
CandleHigh=high[ArrayMaximum(high,bar,iPeriod)];
CandleLow=low[ArrayMinimum(low,bar,iPeriod)];
CandleOpen=open[bar];
CandleHigh1=high[ArrayMaximum(high,bar+iPeriod,iPeriod)];
CandleLow1=low[ArrayMinimum(low,bar+iPeriod,iPeriod)];
CandleOpen1=open[bar+iPeriod];
//---
BuyBuffer[bar]=0.0;
SellBuffer[bar]=0.0;
//---
if(CandleLow<CandleLow1 && CandleOpen>CandleHigh1) BuyBuffer[bar]=low[bar]-ATR[bar]*3/8;
if(CandleHigh>CandleHigh1 && CandleOpen<CandleLow1) SellBuffer[bar]=high[bar]+ATR[bar]*3/8; }

I understood it as mq5:

bool UP = Low[i+2] < Low[i+1] && Open[i+2] > High[i+1] ;

bool DOWN = High[i+2] > High[i+1] && Open[i+2] < Low[i+1] ;

Did I get it right?

==

ATS mq4 https://www.mql5.com/en/code/12941

 
Hello forum users.
I am trying to integrate a library for working with files outside the file sandbox https://www.mql5.com/ru/code/11140.
At the initial stage, however, I'm having problems with elementary file opening. Maybe someone has done something based on this library, please help. Thank you very much!
#include <FileFunctions.mqh>
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   string name=StringConcatenate(Year(),TransformToFileName(Month()),TransformToFileName(Day()),".log");
//---
   string path=TerminalPath()+"\\MQL4\\Logs\\"+name;
//---
   if(FileCheckW(path))
     {
      //---
      int handle=-1;
      handle=FileOpenExistingW(path,GENERIC_READ,SHARE_READ);
      if(handle!=NULL)
        {
         Alert(handle);
         FileCloseHandle(handle);

        }
     }
//
  }
//+------------------------------------------------------------------+
string TransformToFileName(int val)
  {
   string res;
//---
   if(val<10)
     {
      res=StringConcatenate(0,val);
     }
   else
     {
      res=StringConcatenate(val);
     }
//---
   return(res);
  }
//+------------------------------------------------------------------+
Error
 
bistreevseh:
Hello forum users.
I am trying to integrate a library to work with files outside the file sandbox https://www.mql5.com/ru/code/11140.
At the initial stage, however, I'm having problems with elementary file opening. Maybe someone has done something based on this library, please help. Thank you very much!

Maybe this is the problem, for

StringConcatenate()

"Note.

Parameters can be of any type. The number of parameters cannot be less than 2 and cannot exceed 64."

 
bistreevseh:
Hello forum users.
I am trying to integrate my library to work with files outside of file system sandbox https://www.mql5.com/ru/code/11140.
At the initial stage I have problems with basic file opening. Maybe someone has done something based on this library, please help. Thank you very much!

Is the test script working correctly?

Rights and owner to the system drive?

I have a script like this:

#include <FileFunctions.mqh>
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
 {
  string sName = TimeToString(TimeLocal(), TIME_DATE) + ".log";
  sName = StringSubstr(sName, 0, 4) + StringSubstr(sName, 5, 2) + StringSubstr(sName, 8);
  string sPath = TerminalPath() + "\\MQL4\\Logs\\" + sName;
  Print(sPath);
  if (FileCheckW(sPath))
   {
    int hFile = FileOpenExistingW(sPath, GENERIC_READ,SHARE_READ);
    if (hFile != NULL)
     {
      Print("hFile = ", hFile);
      FileCloseHandle(hFile);
     }
    else Print("Файл не открыт!");
   }
  else Print("Файл отсутствует!");
 }

works:

0 07:46:55.195 Check_FileLib EURUSD,Daily: initialized
0 07:46:55.196 Check_FileLib EURUSD,Daily: E:\Market\Forex\Brokers\Alpari\MetaTrader 4.00\MQL4\Logs\20160305.log
0 07:46:55.239 Check_FileLib EURUSD,Daily: hFile = 2020
0 07:46:55.240 Check_FileLib EURUSD,Daily: uninit reason 0
0 07:46:55.241 Script Check_FileLib EURUSD,Daily: removed

 
Zhunko:

Is the test script working correctly?

Rights and owner to the system drive?

I have a script like this:

works:

0 07:46:55.195 Check_FileLib EURUSD,Daily: initialized
0 07:46:55.196 Check_FileLib EURUSD,Daily: E:\Market\Forex\Brokers\Alpari\MetaTrader 4.00\MQL4\Logs\20160305.log
0 07:46:55239 Check_FileLib EURUSD,Daily: hFile = 2020
0 07:46:55.240 Check_FileLib EURUSD,Daily: uninit reason 0
0 07:46:55.241 Script Check_FileLib EURUSD,Daily: removed


Thank you very much! It works weird I have admin rights, I specifically gave all destructions to the owner of the terminal folder, it helped, but then it stopped working. Then tried to read the log file using the FileReadStrArrayW (if I'm not mistaken with the name) read the empty lines, script hangs in ansi mode. Only FileReadCharArr was able to read the ansi codes. Maybe you have some example how to parse log file with your library? I would be very grateful!
 
I'm not sure how to use it and I don't know how to solve this problem. In the indicator is supposed to conduct a comparative calculation using the cycle, in real time on market days the indicator works (albeit slowly), but today I noticed that the calculation is not conducted.
 

Or let me ask a simpler question:

In the OnCalculate() function a loop is inserted, so it only goes through one iteration, the next one only when the graph is updated....

Reason: