[Archive!] Writing an advisor for free - page 16

 

Good afternoon!

There is a problem in writing the Expert Advisor.

When an order is opened, a log file is created in a folder with the name of the symbol. This is all good, everything is great.

But when I try to read data from this file, I get an error that the file doesn't exist. At the same time the paths are all specified in one and the same way.

The reading and creating of the file are implemented in separate functions, I used them before, without any problems, but when I decided to try it with additional folders the problem occurred.


void ReadString(string FileName)
{
string str, stoploss, takeprofit;
int Handle;
int i=0;
Handle=FileOpen(FileName,FILE_CSV|FILE_READ,";");
if(Handle<0)
{
if(GetLastError()==4103)
Print("No FileName ",FileName);
else
Print("Error while opening file ",FileName);
return;
}
while(FileIsEnding(Handle)==false)
{
stoploss=FileReadString(Handle);
takeprofit=FileReadString(Handle);
if(FileIsEnding(Handle)==true)
break;
//---------------------------------------------------------
SL =StrToInteger(stoploss);
TP =StrToInteger(takeprofit);
i++;
}
FileClose( Handle );
return;
}
//+------------------------------------------------------------------+
void CreateFile(string FileName, string Sloss, string TProfit)
{
int Handle,Qnt_Symb;
Handle=FileOpen(FileName,FILE_CSV|FILE_WRITE,";");
if(Handle==-1)
{
Alert("Error opening file. Possibly, the file is busy with another application");
return;
}
Qnt_Symb=FileWrite(Handle,Sloss);//Write to file
Qnt_Symb=FileWrite(Handle,TProfit);
if(Qnt_Symb < 0)
{
Alert("Error writing to the file ",GetLastError());
PlaySound("Bzrrr.wav");
FileClose( Handle );
return;
}
FileClose( Handle );
//----
return;
}


I assume the problem is not with them, but with specifying the path to the file.

By the way, the file is not only not read further, but also not deleted when the same path is specified.


This is how I specified the path:


string x2="\\\";

Path=Symbol()+x2+DoubleToStr(MagicNumber,0);


Who won't be too lazy, please help, because I'm already exhausted, I don't understand what's wrong ((

PS: if you can reply in person or by email :)

 

ForTrade.ru

I am asking you to write an indicator. I want the indicator to draw a zig zag line from highs to lows according to a certain algorithm.

A short term high is a high on both sides of which the highs are lower than that.

A short-term low is a low on either side of which the lows are higher than that.

An inside bar is a bar which is within the range of the previous bar.

To identify reversal points, we ignore the inside bars and all possible reversal points produced by them. The exception will be if the next bars (after the inside bar) overcome the range of the inside bar in the expected direction.

If the indicator will be able to write, then vydvenu trading strategy on these points!

 
Stand down ) found the problem :)
 
sever29 >> :

>> but if you reduce the number of pending orders to a minimum.

This will not do anything. The point here is not whether all pending orders are placed on the chart at once or whether they appear "as the price approaches". When any grid is working, there is a huge amount (up to several hundreds) of open counter positions on the chart.
Also in the account history there is a large number of deleted (failed) positions.
And of course, the broker would realize at once that there is a grider!

He will - with all the consequences....

 
fortrader.ru писал(а) >>
I will write the advisor for free but in turn, write to whom it is necessary http://forum.fortrader.ru/index.php?board=3.0

Hello. Can you advise me on the appropriate literature for writing a manual?

 
shveps писал(а) >>

Hello, could you advise me on the appropriate literature for writing an advisor?

Why literature? There's a film here, and more than one https://forum.mql4.com/ru/27372

 
Hello! Please help me write an EA based on the Triggerlines indicator, so that when the direction of movement changes, opposite orders are triggered, thus closing each other. Maybe there are already such EAs, maybe they are losing? Share your experiences. Help who can.
Files:
 

Good day, found this interesting EA, it all works fine... But have some ideas to improve it, I need to attach Moving Averages to make it work on M1 and take МА parameter from H1. It looks too much like lottery entry system.

Files:
 

http://narod.ru/disk/15176972000/experts.zip.html

Hi all! Have a look at the EA (there are two versions 2 and 3). I checked it on instaforex as alpari does not seem to have 0.01 lot and there under cent. It works fine on GBP/JPY in 40 or 60 corridor, and this pair is rather volatile. In short, it works fine when the market is swinging in different directions, and it is better not to use it on quiet markets...

 
RealMag777 писал(а) >>

http://narod.ru/disk/15176972000/experts.zip.html

Hi all! Have a look at the EA (there are two versions 2 and 3). I checked it on instaforex as alpari does not seem to have 0.01 lot and there under cent. It works fine on GBP/JPY in 40 or 60 corridor, and this pair is rather volatile. It works fine when the market is swinging in different directions and is better not to use in quiet markets...

can not download, send me the code in your inbox.

Reason: