[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 257

 
alsu >> :

try saving the file in csv format and enter it into the terminal using the standard functions for reading csv files...

Can you tell me more about the standard functions and how to use them to draw lines?

 
Slepoy >> :

Could you explain in details what these standard functions are and how you can draw lines with them?

to read from a file

FileReadNumber

FileReadString


to plot

ObjectCreate

ObjectSet

 
Help for a newbie. I'm trying to load a variable 0.0029266 from a file, but only 0.0029 is loaded. Please tell me how to fix it. Below is a part of indicator text.


handle_read = FileOpen(Symbol()+"_result.txt",FILE_CSV,';');

ExtMap[1] = FileReadNumber(handle_read);
 
AlexKet >> :
Newbie help. I am trying to load variable 0.0029266 from a file, but only 0.0029 is loaded. Can you tell me how to fix it. Below is a part of indicator text.


handle_read = FileOpen(Symbol()+"_result.txt",FILE_CSV,';');

ExtMap[1] = FileReadNumber(handle_read);

How do you know what you are downloading? What function did you use?

 

Question for Expert Advisors

How to write the data import from an indicator in an EA? I need a fast and a slow buffer.


int start()
  {...
   
      FastBuffer[ i]=iMAOnArray( Buffer,Bars, FastMA,0,MODE_LWMA, i);
      SlowBuffer[ i]=iMAOnArray( Buffer,Bars, SlowMA,0,MODE_LWMA, i);
...
#import "улдьт.ex4"
int  FastBuffer,int  SlowBuffer;

Or write more info in the indicator

#import  "улдьт.ex4"
  double FastMABuffer(int i);
  double SlowMABuffer(int i);
#import
 

Please help.

Here is the code. In theory, the Expert Advisor should work with its own orders (to detect Magic), but if I ran multiple copies of the EA for different currency pairs, for some unknown reason, it starts opening a bunch of identical orders (and should open only 4). Already broke my head trying to figure it out

Files:
dddddd.mq4  4 kb
 
Skydiver писал(а) >>

Please help.

Here is the code. In theory, the Expert Advisor should work with its own orders (to detect Magic), but if I ran multiple copies of the EA for different currency pairs, for some unknown reason, it starts opening a bunch of identical orders (and should open only 4). I have already wracked my brains trying to figure it out.

The problem is in your cycle of counting "your" orders. It can be corrected like this:

///count of "own" orders
for(cnt=0;cnt<OrdersTotal();cnt++)
{
if (OrderSelect( cnt, SELECT_BY_POS)==true)
{

if ( OrderSymbol() == Symbol() ) // this line is necessary if you will count the number of orders for the symbol
if(OrderMagicNumber()==Magic) { total=total+1;}
}
}

 
Mislaid Thank you very much! I've been thinking for five hours. I couldn't think of anything but the wrong thing.
 
costy_ >> :

Question for experts

How to import data from the indicator to the Expert Advisor? I need a fast and slow buffers.


Or you have to add them in the indicator

double iCustom(string symbol, int timeframe, string name, ..., int mode, int shift)
Calculation of the specified custom indicator. The custom indicator must be compiled (file with EX4 extension) and located in terminal_directory/experts/indicators.

Parameters:
symbol - Symbol name of the symbol, on data of which the indicator will be calculated. NULL means current symbol.
timeframe - Period. Can be one of the periods of the chart. 0 means the period of the current chart.
name - Name of custom indicator.
... - List of parameters (if necessary). Transmitted parameters should correspond to the order of declaration and type of external (extern) variables of the custom indicator.
mode - Index of the indicator line. Can be from 0 to 7 and should correspond to the index, used by one of the SetIndexBuffer functions.
shift - Index of the value obtained from the indicator buffer (shift relative to the current bar by the specified number of periods back).
Example:
  double val=iCustom(NULL, 0, "SampleInd",13,1,0);


Long live help!

 

Hi all.I have MT4 (mini) Demo, advise advisor on stoch (5.3.3): when the stop. dipping and crossing the level of 20-closed order on the SAL, and when the reversal-open on the BAI also on 20, so also on top. somewhere so, this is a rough explanation, and how better to tell YOU.thank you.