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

 

Boneshapper 07.04.2011 15:58 am Correction | delete

Hello again!

Can you please advise in the following:

1.there is a function "if (timecur == "08:00:00") OrderSend (Symbol(), OP_BUY, Loot, Ask, 50, SL, TP,NULL,0,0,L);"

2.Testing it from 23.08.2010-23.10.2010.

3.Until 12.10.2010 trades were opened normally by 1 pc.

4.But now the 12.10.2010 function opens as much deals as the deposit allows (about 7 pc).

I can not understand the reason, may be that for a second has time to pass at least 5 ticks and therefore has time to open so much? or there is another matter? if all the same first option, please advise how to prescribe the deal opened only once?

I would be very grateful, thank you.

 

Do this

int flag=0;
...
int start()
{
if (timecur == "08:00:00") 
{
if  (flag==0)   
{
   OrderSend (Symbol(), OP_BUY, Loot, Ask, 50, SL, TP,NULL,0,0,L);
   flag=1;
   }
}

else flag=0;
...
 
Hi all. Please advise which way to dig - we need to add interactive controls (buttons) to the tool window. Thanks in advance, colleagues!
 
Pyro:
Hi all. Please advise which way to dig - we need to add interactive controls (buttons) to the tool window. Thanks in advance, colleagues!
https://www.mql5.com/ru/forum/132771
Discussed here
 
Roger:

Do this


Thank you very much, I'll try it.
 

Hello! Just finished reading the tutorial and started making a program for trailing stop. Took a valid code... and immediately had some questions: 1. if (BuyStop) {..... how do I understand it? What does Buy Stop return? what condition does it set?

2. How does the program open orders if ORDER SEND is first encountered in the line - if (OrderSend(Symbol(), OP_BUYSTOP, Lots, l_price_16, 0, l_price_0, l_price_8, 0, MagicNumber, 0, Blue) == -1) {
Alert("Error: ", ErrorDescription(GetLastError()));
return (0);
it turns out the function is called from the condition statement? I would be very grateful for help)))

 
Lisi4ka330:

Hello! Just finished reading the tutorial and started making a program for trailing stop. Took a valid code... and immediately had some questions: 1. if (BuyStop) {..... how do I understand this? what is Buy Stop return? what condition is set?

2. How does the program open orders if ORDER SEND is first encountered in the line - if (OrderSend(Symbol(), OP_BUYSTOP, Lots, l_price_16, 0, l_price_0, l_price_8, 0, MagicNumber, 0, Blue) == -1) {
Alert("Error: ", ErrorDescription(GetLastError()));
return (0);
it turns out the function is called from the condition statement? I would be very grateful for your help)))

Your questions are not about trading functions.

They relate to basic knowledge of programming languages. This is where c++ books can help you.

 
sergeev:

your questions are not about trading functions.

They relate to a basic knowledge of programming languages. This is where c++ books can help you.

Thanks, now I understand that it's not "OUR")))

 
Lisi4ka330:
...it turns out that the function is called from the condition statement? I would be very grateful for help)))
The function must be executed to check the condition, hence there will be an attempt to open an order, the result of which will check the conditional operator.
 
Roger:

Do this


I can't. It still buys a bunch:( Please tell me what else can be done.