[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 17

 
demlin:

Hi all!

I'd like to ask some knowledgeable people to tell me what the libraries in MQL4 are and what to eat them with. Thank you in advance.


If you have understood the meaning of "libraries", let people correct you... in the full range.
 
DDFedor:

Tell us what you mean by "libraries" and people will correct you... thewhole program.
A set of ready-made programs for all occasions.
 
Exactly. Did you want to stress people out by having them spell it out for you? It is programs (functions) written in a separate file, which is included in the file to be compiled.
 
DDFedor:
Exactly. Did you want to have people explain everything to you? It is programs (functions) written in a separate file, which is included in the file to be compiled.
It's understandable. What's not clear is how to work with them. You don't have to spell it out, just throw in a link, I'm in favor of self-education :)))
 

1. We know that the examples lie in the codebase.

2. We know that library file extension is mqh.

3. Combine, do a search engine query.

4. We get the first result. https://www.mql5.com/ru/code/10344 - I haven't looked at the archive, but there must be a library file and a startup file.

 
People, I apologise in advance if I ask silly questions. I am still a dummy in programming, but I can't wait to run my first EA.) More or less copes with it, but here's the problem I have: I need to configure the Expert Advisor so that the risk per trade is 10 percent of the deposit, and that these 10 percent would fall within a distance to SL, which is different in almost every transaction, and the 10 percent should be increased each time by 50% after a losing trade. For example the deposit of 10 000 USD, the risk per trade at a certain known level of SL should be 1000 USD. If the trade is loss-making, then the next trade must risk 1500, the next 2000, etc. And on the first profitable trade the risk immediately returns to the initial level of the deposit: 10%. How can this be implemented in the programme?
 
vovan-gogan:
People, I apologise in advance if I ask silly questions. I am still a dummy in programming, but I can't wait to run my first EA.) More or less copes with it, but here's the problem I have: I need to configure the Expert Advisor so that the risk per trade is 10 percent of the deposit, and that these 10 percent would fall within a distance to SL, which is different in almost every transaction, and the 10 percent should be increased each time by 50% after a losing trade. For example the deposit of 10 000 USD, the risk per trade at a certain known level of SL should be 1000 USD. If the trade is loss-making, then the next trade must risk 1500, the next 2000, etc. And on the first profitable trade the risk immediately returns to the initial level of the deposit: 10%. How can this be implemented in the programme?

The repetition of messages in different threads is spam, while spam is punished with a ban. This is a warning.
 
kaats 27.07.2011 14:17

if(ObjectFind("VerticalLine")!=-1){
datetime TimeVL=ObjectGet( "VerticalLine", OBJPROP_TIME1); //получили координату времени где стоит вертикальная тиния с именем VerticalLine, которая сознательно выставлена - так как не проверяется какая это линия и тд
int shift=iBarShift(NULL, 0, TimeVL); //получил смещение линииот текущего момента в свечах

//int c=Bars-shift; //если вдруг хочется до конца истории вывести значение индикатора (после линии)

int c=10; // а это на скольких свечах после вертикальной линии анализировать значение индикатора
for(int i=shift; i<=shift+c; i++){
//double x=iCustom(NULL, 0, "СвойИндикатор", ..., int mode, i); // тут вроде как свой индикатор ....
double x= iMA(NULL, 0, 12, 0, MODE_SMA, PRICE_CLOSE, i) ; // для примера вывод МА
Print("x=",i," MA=",x);
}
}
else Print("Нет Вертикальной линии");

- будьте внимательны - если код будет работать потиково - будет масса данных для анализа :) на каждом тике код выполняется заново

это если я, конечно, правильно понял что вы хотите

Probably not quite right, or I've got it wrong, here's a drawing of what I want to achieve.

 
Vinin:

Repeating posts in different threads is spam, and spam is punishable by a ban. This is a warning.

Sorry. I just saw this section later. )
 
vovan-gogan:
People, I apologize in advance if I will ask silly questions. I am still a dummy in programming, but I cannot wait to run my first Expert Advisor.) More or less copes with it, but I have this problem: I need to configure my Expert Advisor so that the risk per trade is 10 percent of the deposit, and those 10 percent would fall within a distance to SL, which is different in almost every trade - and the 10 percent should be increased by 50% each time after a losing trade. For example the deposit of 10 000 USD, the risk per trade at a certain known level of SL should be 1000 USD. If the trade is loss-making, then the next trade must risk 1500, the next 2000, etc. And on the first profitable trade the risk immediately returns to the initial level of the deposit: 10%. How can this be implemented in the programme?

A similar question has been asked and answered here before (I don't remember who answered it). Just so you don't have to look it up, here it is:

-----------------------------------------
How to calculate, based on available funds and lot, how many points (in points) the price can go down??? Does anyone have such a code???
link formula: Lot=Money/(Staples*Tick)
Money - earned/lost
Stoplos - broker's pips
Tick - MarketInfo( MODE_TICKVALUE)
From here, twist as you wish:
Stopplus=Money/(Lot*Tick)
Money=Lot*Stopplus*Tick
-----------------------------------------
Now, based on the above formulas, do what you need...