[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 342

 

Breakeven advisor (version 4)

https://www.mql5.com/ru/code/10251

 
moved.
khodakvv:
Please write the code of the formula that calculates the lot at 3 per cent risk of free funds. Thank you
 
khodakvv:
Напишите, пожалуйста, код формулы, рассчитывающей лот при риске 3мя процентами свободных средств. Благодарю
Check out the textbook - here...
 
Please give me the code to open a deal only the first 10 minutes of each hour (in my case it opens at the beginning of the hour, closes at take profit and reopens a deal - already lossy).
 
beekeeper:
Can you please give me the code to open a deal only the first 10 minutes of each hour (I open at the beginning of the hour, close at take profit and reopen the deal - this is a loss-making one)?

Look - here on this forum, Sator posted a theme "Only useful fiqs from Kim IV" - carefully re-read - find fi - time restriction on the work of the owl.
 
charter:

As one of the many options available:

If you know how to place at least one pending order, it should be easy to open three.

Each order can be assigned its own magik (this will make it easier to track the order) with corresponding TP levels to that magik.


Yes, thanks, I guess I've been working too hard and missed the magician option, I'll give it a try.

Thank you for your reply.

 
Roman.:

Look - here on forum Sator posted a topic "Only useful fie from Kim I.V." - read it carefully - you will find fie - time restriction of owl operation.


Thank you.

https://forum.mql4.com/ru/38949/page9#434297

I tried it this way and that way... the time limit is set by hours (and minutes)... only by minutes is needed...

 
beekeeper:


Thank you.

https://forum.mql4.com/ru/38949/page9#434297

I've tried it this way and that way... the limit is in hours (and minutes)... I just need the minutes...


exclude the clock...
 
beekeeper:


Thank you.

https://forum.mql4.com/ru/38949/page9#434297

I tried it this way and that way... the limitation takes place by hours (and minutes)... I only need to do it by minutes...


Here are some more examples - adjust to your conditions...

2. Please tell me how to make my EA stop trading at 21h00min and start at 01h00min on the next day.

int start()

{ 


if (Hour()>20 && Hour<2) return(0);


.....


}

3. Please tell me how to make my EA stop trading at 21h00 and start at 01h00 the next day only. I think this is not very hard, even for beginner, but I am a total zero in programming. Therefore, if possible, please give me more details, point by point.

bool is_siesta=false;

int start {


if(Hour()<21 && Hour()>=1)is_siesta=true;


if (is_siesta){


ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Bid-25*Point,Ask+25*Point,"My order #"+counter,16384,0,Green);


if(ticket<0)


{ Print("OrderSend failed with error #",GetLastError());


return(0); } 


} 


}

Can someone tell me a piece of code, which will allow to make certain actions, for example, every 10 min.

Declare a variable

datetime StartTime=0;

You can add the following code to the initialization block

StartTime=0;

Then, in the start of the EA, we write:

if(StartTime=0){

StartTime=TimeCurrent();// устанавливаем счётчик времени в стартовое состояние

// вычисляем, сколько секунд в 10 минутах

// 60 секунд - это одна минута, 60*10 = 600 секунд в 10 минутах

}

else{

if(TimeCurrent()-StartTime>=600){// Прошло 10 минут

StartTime=TimeCurrent();// устанавливаем снова счётчик времени в стартовое состояние, после чего:

// выполняем какие-то действия

}

}

 
Burned! 5+ )))))))))) Where will DC go with my TP? Will it turn back?
Roman.:

If you don't want to show your tees and stops DC.....