[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

 
alsu:
Each order has a unique number called OrderTicket(). This can be used to track it down.
I have found the function Kim. But all the same, I can't figure out how to close the pending one which was opened in pair with buy.
 
Top2n:
But all the same, I can't figure out how to close the pending one that was opened in the buy pair.
For example, I can set a magik ticket to the buy.
 

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.
int schet=0;
int start()
  { double Lots;
//----
 for(schet;schet<kolitsestvo;schet++){
 
Dimka-novitsek:
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++){

 
Top2n:

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.

 

        int schet=0;
int start()
  { double Lots;
//----
 if(schet<kolitsestvo){schet++;
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.

 
Dimka-novitsek:


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

int start()
{ 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?

подается сигнал "sig1" срабатывает команда BUY и устанавливается отложенный ордер SELLSTOP ниже ордера BUY.

при закрытие позиции BUY , SELLSTOP тоже удаляется.

Но как быть когда этот BAY не закрылся, и открылся следующий BUY и следующий и т.д.

Этот SELLSTOP который установлен первым нужно как то вычислить, чтоб закрыть после того когда уже и первый BUY закроется.

Может у кого нибудь есть готовый  код. Пробовал через функции Кими в частности: 

пытался возвратить тикет последнего закрытого ордера и сравнить его с тикетом отложенного ордера прибавив к нему 1-( т.к. отложка открывалась всегда после бая)

но нечего не вышло. Помогите плиз без вас не куда)