[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 737

 
trader265:
Guys, thank you all very much. I'll get right on it. If it doesn't work out, can I bother you?

Even if no one's here today, your post will be seen tomorrow. It's not like we have an office here :) where everyone leaves at the end of the day :)
 
drknn:


The logic is as follows:

The limit of 8 indicator buffers is due to the language itself. There is no point in limiting the number of other arrays, because it cannot exceed the size of RAM + swap file anyway. Therefore, it's not worth overdoing it. I mean a certain amount of RAM is allocated for the array.

Here's my problem:'SymbolSellColor' - internal stack overflow-simplify the program, please

Increasing the stack doesn't help. Code - simple, I'm not good at writing complex. RAM, swap - not a problem, it's enough.

 
Abzasc:

Here's my problem: 'SymbolSellColor' - internal stack overflow-simplify the program, please

Stack overflow - doesn't help. The code is simple, I'm not good at writing complex. RAM, swap - not a problem, it's enough.


Ask the developers - maybe there are some problems that we do not know.
 

I have a question why a pending order does not open, please help me.

extern int TakeProfit=100;
extern int StopLoss=100;
extern double Lot=0.01;
extern int StartTime=0;
int Today=0;
int h=100;
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
{if(DayOfWeek()==0 || DayOfWeek()==6) return(0); // в выходные не работаем
if(!IsTradeAllowed()) return(0); // пропустим тик если терминал занят
int total = OrdersTotal();
if(total == 0)

   {NewOrder(OP_BUY,Lot);
    NewOrder(OP_SELL,Lot);
    NewOrder(OP_BUYLIMIT,Lot);
    Today=TimeDay(TimeCurrent());}
return(0);}

  
//+------------------------------------------------------------------+
int NewOrder(int Cmd,double Lot)
{double TP=0; //тейкпрофит
double SL=0; //стоплосс
double PR=0; //Цена
double PR1=0; //Цена1
while(!IsTradeAllowed()) Sleep(100);
if(Cmd==OP_BUY)
   {PR=Ask;
    if(TakeProfit>0) TP=Ask+TakeProfit*Point;
    if(StopLoss>0) SL=Ask-StopLoss*Point;}
if(Cmd==OP_SELL)
   {PR=Bid;
    if(TakeProfit>0) TP=Bid-TakeProfit*Point;
    if(StopLoss>0) SL=Bid+StopLoss*Point;}
if(Cmd==OP_BUYLIMIT)
   {PR1=Ask-Point*h;
    if(TakeProfit>0) TP=PR+TakeProfit*Point;
    if(StopLoss>0) SL=PR-StopLoss*Point;}
int tic=OrderSend(Symbol(),Cmd,Lot,PR,3,SL,TP,0,0,CLR_NONE);
int tic1=OrderSend(Symbol(),Cmd,Lot,PR1,3,SL,TP,0,0,CLR_NONE);
if(tic<0) Print(GetLastError());
if(tic1<0) Print(GetLastError());
return(tic);}
 
FoxUA:

question what is the error why pending order won't open help please

I recognise my comments in your code :))))))))))

Check what exactly you pass to the function as a parameter and what exactly the function gets when it runs - print it out.

 
drknn:
I recognise my comments in your code :))))))))))

Check exactly what you pass to the function as a parameter and exactly what the function gets when it runs - print that.


I have been collecting the Lego constructor for about 3 hours and the pending order does not want to open.
 
drknn:
I recognise my comments in your code :))))))))))

Check exactly what you pass to the function as a parameter and exactly what the function gets when it runs - print that.


I see how to make the next function

int tic=OrderSend(Symbol(),Cmd,Lot,PR,3,SL,TP,0,0,CLR_NONE);


after this function

int NewOrder1(int Cmd,double Lot)
{double TP=0; //тейкпрофит
double SL=0; //стоплосс
double PR1=0; //Цена1
while(!IsTradeAllowed()) Sleep(100);

if(Cmd==OP_BUYLIMIT)
   {PR1=Ask-Point*h;
    if(TakeProfit>0) TP=PR1+TakeProfit*Point;
    if(StopLoss>0) SL=PR1-StopLoss*Point;}

int tic1=OrderSend(Symbol(),Cmd,Lot,PR1,3,SL,TP,0,0,CLR_NONE);

if(tic1<0) Print(GetLastError());
return(tic1);}
 

I get it, you just need to set the operator not just one parameter, but through else

 

Question, what function is responsible for the expiry date of a pending order? I don't see it and it says 147 Using the expiry date is not allowed by the broker

 

expiration - expiration date of the pending order. When the expiration time arrives, the pending order will be automatically closed on the trade server. On some trade servers the application of pending orders expiration time can be prohibited. In this case, when trying to set a non-zero value of the parameter, the trade order will be rejected.

What value should be set so that the order is not rejected?

Reason: