[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 215
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Each order has a unique number called OrderTicket(). This can be used to track it down.
But all the same, I can't figure out how to close the pending one that was opened in the buy pair.
Good day to all.
I have tried to write an indicator, it seems to work, but only on the history it draws as planned and then when new quotes come in it draws a usual mask.
The code is attached:
int start()
{
int counted_bars=IndicatorCounted();
int i,n;
double Stark=0;
//----
i=Bars-counted_bars-1;//+50;
// n=Bars-counted_bars-1;
while(i>=0)
{
//----
double Ma=iMA(NULL,0,PerMa,Shift,MODE_EMA,PRICE_CLOSE,i);
//double Ma1=iMA(NULL,0,PerMa,Shift,MODE_EMA,PRICE_CLOSE,i+1);
if(Stark+Step*Point<Ma)Stark=Ma;
if(Stark-Step*Point>Ma)Stark=Ma;
ABuf[i]=Stark;
//----
i--;
}
return(0);
}
Please help me to fix it so it will keep drawing steps.
I would really appreciate it.
Gek.
Good afternoon!!! Please remind me how to write the expression correctly, because the compiler swears. Asigment him, a semicolon seems redundant.
Change the first two lines.
More precisely
int start()
{ double Lots; int schet=0;
//----
for(schet;schet<kolitsestvo;schet++){
ticket of last closed position==with pending position set + 1
Hi, is the server only opening positions for you?
The OrderSend function has a magic field - use it.
Gek34:
Change the first two lines.
I'm sorry, will the loop then run the number of times? Nah, here I thought-no, it'll definitely be on every tick. Okay, I'll think about it. Thank you.
I'll think about it.
Excuse me, will the loop then be executed the number of times? No, I'm thinking-no, it's definitely going to be on every tick. Okay, I'll think about it. I'll think about it. Thank you.
Thought.
This is how it will execute the right number of times
{ double Lots;
//----
for(int schet=0;schet<kolitsestvo;schet++){
Gentlemen, I haven't been able to get an inch closer to solving this problem all day long.
How to implement this algorithm in code?