Useful features from KimIV - page 50

 
Vkorch писал (а) >>
What to do?

>> take a closer look

Files:
e_test.mq4  10 kb
 

Thank you so much! Got it sorted. I'll see if it works tomorrow.

 

Happy fifty pages !!! ;)

Igor, thank you very much for such useful work...

As "combat training" I present to your judgment my own hand-written function

to calculate the average hospital temperature... and to point out any miscalculations or errors...

This function calculates the daily average of the traded symbol in pips

for the specified range of daily bars using the formula High of the day - Low of the day / number of bars= AverDays

starting from "today" and ending with the last one in the available history depth...

int AverDays()
{
double b;
string simb=Symbol();
int i, c, allb=iBars( simb,PERIOD_D1);
int dg=MathPow(10,MarketInfo( simb,MODE_DIGITS));
for( i=0; i< allb; i++)
{ b+=(iHigh( simb,PERIOD_D1, i)-iLow( simb,PERIOD_D1, i))* dg;}
c= b/ allb;
return( c);
}

"... as whips are mercilessly flogged and beards trimmed until they get wise..." (c) P.1.

 
rid >> :

Hi all. To avoid having to dig through pages every time, I had to make the content branch by branch.

I have consolidated the functions of similar themes here and there. Contents from 1 to 40 pages.

Those who wish may continue and add some other pages and lay out here.

Thank you, useful work done. It would be even better if links were inserted to go to the right page.

 

I join in congratulating you on your 50th birthday!!!

2 khorosh:

I don't know if the author of the branch will allow my amateurishness, but I've gone further...

I'll try to collect all the functions into one ledger in about this form (see trailer).

I am waiting for an answer to a simple question from Igor and the forum guys: do I need it or not?

I temporarily deleted the attached file until the author fully approves it.

 

Attempt number two!

Somebody! Help a beginner to deal with splitting positions.

For example,I opened a buyposition=0.3 lots, above there is an indicator in the form of a channel,

According to the system, at each level must close

What happens in reality? The price moves upwards

reaches the near level, the criterion to close the position at 0.1 lot, then the price, for some time decreases below this level.

After some time, the price falls below this level and goes up again.

I want to close 0.1 lot on every level.

I have to close 0.1 lot on each level, no more than 0.1 lot, no matter how the price moves back and forth.

Is it possible in MQL4? I understand that the library functions are more important than my question, but

but I hope to get an answer.

 
Goalkeeper писал(а) >>

I'll try to collect all the functions into one ledger, like this (see trailer).

I'm waiting for an answer from Igor and the forum people to one simple question: do I need it or not?

I think it is necessary! Not a bad start!

//------------------------------------------------------

p.s. Especially impressed by the photo of the author of the features before each description!

//------------------------------------------------------

Well, if seriously - really. Useful work!

 
6232 писал(а) >>

Attempt number two!

Somebody! Help me. I need each level to close

0.1 lot at each level, no more, no matter how the price moves back and forth.

Is it possible ...

I think it is possible. Probably, we should check at every level (when crossing) what the current lot size of the open position is. And exactly using this criterion we should implement a closing mechanism !

Such functions (that returns the lot size) are available in this branch. Look at pp. 17 и 27

For example :

Function GetLotLastPos(). Page 17

This function returns the lot size of the last opened position or -1

If lot=0.3, - the closing of 0.1 lot on the first level, i.e.

if ( пересечение первого уровня) {
if ( GetLotLastPos(NULL,OP_BUY,-1)==0.3) {//если это OP_BUY и размер лота =0.3 
        (OrderClose(OrderTicket(),0.1,Bid,3,Green));//закрываем 0.1 лот
... ... ... 

If lot=0.2, - the closing of another 0.1 lot on the 2nd level.

If lot=0.1, then the closing of the remainder at level 3 !

Go for it !

 
rid >> :

//------------------------------------------------------

p.s. Particularly impressive is the photo of the feature author before each description!

//------------------------------------------------------

I don't get it. Maybe I have something wrong? Igor's photo seems to be on the title page only... Or on every page? I could fit it in some top right corner, for example...

And what would Igor himself say about such a "textbook"? In principle, I'm going to make it anyway, for myself... So I only ask permission to post it in this thread (and on the Internet in general). After review and correction by the author himself, of course.

 
Goalkeeper писал (а) >>
And what will Igor himself say about such a "textbook"?

I didn't want to speak out... But since you insist...

Take away the criticism of Sergei Kovalyov's textbook. It has no place there. You can mention the textbook itself and even insert a link to it, but remove the criticism.

Reason: