[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 448

 
Barto писал(а) >>
Respected gurus!
Please don't let it go unnoticed.

I bought a HP laptop with Windows Vista preinstalledwith 64 bit OS.
Started having problems with the work of the EA. At the beginning my trades opened somehow. But in a week my Expert Advisor stopped opening my trades completely. We tried and twisted it and finally decided that the problem was caused by 64 bits. We reinstalled it and installed 32 bits and 7 Windows. It worked fine for one day and then failed again. Maybe I got some kind of update that affects it?

On other computers (colleagues), the EA works without any interruptions at all. My old laptop is gone and I can't buy anything at the moment.

I am, by the way, working on Instatrader platform.

Please, if anyone has encountered, or have any suggestions on how to fix it, please advise.

Logs are needed.

 
qwerewq >>:

фактически это и есть функция только все зависит что стоит если if(Close_){ - то применяйте внутри старта, если void Close_() { как функцию работающяая за пределами старта.


Oh crap, there is still an error

: OrderClose error 4107

: invalid price 1.48337000 for OrderClose function


 

can you please tell me where I'm stupid?




void WritingLineInFile(string FileName, string text)

  int file_handle=FileOpen(FileName, FILE_READ|FILE_WRITE, " ");

	if (file_handle>0)
	{
		FileSeek(file_handle, 0, SEEK_END);
		FileWrite(file_handle, text);
		FileClose(file_handle);
	}
	
}


int start()
  {
WritingLineInFile('test.csv','ololo');

   return(0);
  }
 
Summer писал(а) >>

>> can you please tell me where I'm stupid?

void WritingLineInFile(string FileName, string text)

  int file_handle=FileOpen( FileName, FILE_READ| FILE_WRITE, " ");

if ( file_handle>0)
{
FileSeek( file_handle, 0, SEEK_END);
FileWrite( file_handle, text);
FileClose( file_handle);
}

}


int start()
  {
WritingLineInFile("test.csv","ololo");

   return(0);
  
How about this. (I changed the inverted commas)
 
Vinin >>:
А если так. (Я кавычки поменял)

Thanks, thought it was important, fixed a few more bugs and it's working.

void WritingLineInFile(string FileName, string text)
{  
  int file_handle=FileOpen( FileName, FILE_READ| FILE_WRITE, " ");

	if ( file_handle>0)
	{
		FileSeek( file_handle, 0, SEEK_END);
		FileWrite( file_handle, text);
		FileClose( file_handle);
	}
}



int start()
  {
WritingLineInFile("test.csv","ololo");

   return(0);
  }
 

Good afternoon, friends.

Please advise me on this issue:


I practice semi-automatic trading on different timeframes (with several TFs open on one currency pair)

when a signal to open a position is generated, it is desirable to know, for clarity, on which TF this signal was received.

Can you advise how to make the TF also be displayed in the message prompting to open a position?

(maybe something should be added to OrderSend)

 
Morzh09 >>:

Добрый день, друзья.

Подскажите, пожалуйста, по такому вопросу:


практикую полуавтоматическую торговлю на разных таймфреймах (при этом, на одной валютной паре открыто несколько TF)

когда генерируется сигнал на открытие позиции, желательно знать, для наглядности, на каком TF этот сигнал был получен.

посоветуйте, как сделать так, чтобы в сообщении-предложении открыть позицию также отражался и TF?

(может быть нужно что-то в OrderSend подставить)

OrderSend has nothing to do with it, you open positions by some condition,

You open position by some condition, the message is generated and you should add to this message the indication of the TF where the signal came from.

It is done by the standard function for determining the TF --> Period().

 
Urain >>:

OrderSend тут не причём, вы открываете позици ведь по какомуто условию,

по этому же условию формируеться сообщение вот и добавьте в это сообщение отображение ТФ откуда прищёл сигнал.

Делаеться это стандартной функцией определения ТФ --> Period().

OK, thank you very much.


If it is not difficult for you, please advise on this point:

when opening I write in the comment the deal type - "Buy" and the timeframe - Period().


ticket = OrderSend(Symbol(), OP_BUY, lots,NormalizeDouble(Ask, Digits), 3, NormalizeDouble(Bid, Digits) - sl * Point, 0, "Buy " + Period(), MagicNumber, 0, Blue);


but on timeframes less than H4 this comment doesn't work...

Only "Buy" is written...

 

I don't know what you mean, I ran your code on mine and the comment is registered on all TFs.

//+------------------------------------------------------------------+
#property copyright "Urain"
#property link      ""
#property show_inputs

//+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
int sl=100;
int MagicNumber=123456789;
double lots=1.0;
int start()
{//+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
 int ticket = OrderSend(Symbol(), OP_BUY, lots,NormalizeDouble(Ask, Digits), 3, NormalizeDouble(Bid, Digits) - sl * Point, 0, "Buy " + Period(), MagicNumber, 0, Blue);
 Alert("end ", ticket); 
return(0);
}//+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~+
 
Urain >>:

Не знаю о чём вы, я запустил ваш код у себя и комент прописываеться на всех ТФ.


OK, thank you very much.

No further questions - my mistake was inattentive.

The message is displayed on all TFs.

Reason: