[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 48

 
Can you tell me how to prescribe in ObjectSetText() values of the indicator, for example RSI, I did it with arrows and they are drawn as necessary at a certain time, then instead of arrows I want to display a text with the values of the indicator at a certain time ObjectSetText(Name, RSIBuffer[i],10, "Times New Roman", Green), but I want to display word Text instead of value. Thank you!
 
Vinin: OrderType()==6



Victor, thank you for your succinct reply :-P (it took me several days to get it...:-P) - should have immediately used the search on this request. I read that it is not a trade conducted from the client terminal, so it is not documented ... - here.

For those interested in a similar issue (adjustments (additions) to position volumes when depositing/withdrawing funds to a trading account), people have laid out a whole library in codebase here.

The freely available Expert Advisor is here.

P.S. Information on the accepted value of trading f-fi

 OrderType()== 6

0 Buy
1 Sell
2 Pending BUY LIMIT order
3 Pending SELL LIMIT order
4 Pending BUY STOP order
5 Pending SELL STOP order
6 Additional information - deposit, withdrawal, bonuses

 
delf:

Hello.

Could you tell me what type==4 means?

and type==5

in the following snippet:

double ma=iMA(Symbol(),PERIOD_D1,21,0,MODE_SMA,PRICE_CLOSE,0);

for(int k=1; k<=OrdersTotal(); k++)
bool select=OrderSelect(k-1,SELECT_BY_POS);

if(select)
{
int type=OrderType();
int ticket=OrderTicket();

if (Bid<ma && type==4)
OrderDelete(ticket);
if (Bid>ma && type==5)
OrderDelete(ticket);
}

I understand the conditions for deleting orders, by ma is clear, but together how ?

Thank you.

I was going to answer it myself, but Roman had already written it (see the post above), and it was on a different topic, but the answer was spot on.
 
sergeev:
nothing...
I would have killed without waiting a minute.
Uh-huh... :) I'm stubborn...
 
Vinin:

You don't look at the code before you put something somewhere...

... and an inquisitive experimenter... :)

... Hanging the author of the code by the tomatoes... :)

 
Vinin:


Try it this way, there are no parameters

Although the indicator makes full recalculation on every tick.


Try it this way, there are no parameters
Up_Line iCustom(  NULL, 0, "ExTrendv2", 0,1);
Down_Line iCustom(NULL, 0, "ExTrendv2", 1,1);

Although the indicator makes full recalculation on every tick.

Victor, good day.

I tried to do it and printed it. The indicator shows some ten-digit numbers.

 
Stells:

Try it this way, there are no parameters, I think.

Although the indicator does a full recalculation on every tick.

Victor, good afternoon.

I tried to do it, I printed it. The indicator shows some ten-digit numbers.

I dare say (I won't put the indicator on the chart anymore, and I don't want to finalize it), it outputs the EMPTY_VALUE constant - an empty value. But at certain times, when data appears in the buffer, it will print the normal values. Do a check, for example:

if (Up_Line!=EMPTY_VALUE) {код обработки значения нулевого буфера}
 
People, help me understand this code:
int start()
  {
//----Переменные
double Lots = 1.0;
int Magic = 099;
double Money = AccountBalance();
double MA1_1, MA1_2, MA2_1, MA2_2, MA3;
// Определение MA
MA1_1 = iMA(NULL, 0, MA_Period_1, 0, MODE_SMA, PRICE_CLOSE, 1);
MA1_2 = iMA(NULL, 0, MA_Period_1, 0, MODE_SMA, PRICE_CLOSE, 3);
MA2_1 = iMA(NULL, 0, MA_Period_2, 0, MODE_SMA, PRICE_CLOSE, 1);
MA2_2 = iMA(NULL, 0, MA_Period_2, 0, MODE_SMA, PRICE_CLOSE, 3);
MA3 = iMA(NULL, 0, MA_Period_1, 0, MODE_SMA, PRICE_CLOSE, 2); 

//----Пересечение MA вверх. Сигнал Buy
if (MA2_2>MA1_2 && MA2_1<MA1_1)
{
   if (OrdersTotal()<= 1)
   return;
      if (Low[2]<MA3)
      return;
         double SL = 0.0;
         double TP = 0.0;
         double B_Price = 0.0;
         SL = Low[1]-1*Point;
         TP = (High[1]-Low[1]) * 10 + High[1];
         B_Price = High[1] + 3* Point;
         OrderSend (Symbol(), OP_BUYSTOP, Lots, B_Price, 0, SL, TP, "My order", Magic);
}
           
//----
   return(0);
  }
Why this EA doesn't put a pending order when the MA is crossed.
 
vovan-gogan:
People, help me with code: Why this EA doesn't put a delay when MA is crossed.

and which block does the EA reach? do Print / Alert at different places in the code.

Are there any errors ?

 
I can't figure out which block to go to. I don't know how to use Alert properly yet. No errors