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

 
Fduch >> :

>> Maybe so:

>> oh-oh-oh, thank you, thank you, all right.

 
Fduch >> :

Maybe so:

This is the removal of arrows. If you are interested in other objects, read help on ObjectGet() function

But the loop must be fixed like this, otherwise it will delete only every 2nd object.

for(int k=ObjectsTotal()-1; k>=0; k--)
 

Good day to you all!


I have an indicator with values ranging from 0 to 100. I want to add some levels in it, including trader's choice (I want to add 50 as a base level).

How can I do this in the code?

 
NEKSUS_ >> :

Well, I don't know mql at all, and the script works, but it needs to be run 7 times and in the end there are still a few objects on the chart

Well, I said decremented.

for (int li_0 = ObjectsTotal(); li_0 > 0; li_0--) {
if (ObjectGet(ObjectName(li_0),OBJPROP_ARROWCODE)==158) {
ObjectDelete(ObjectName(li_0))
}
}

 
Talex >> :

Only the loop has to be fixed like this, otherwise it will only remove every 2nd object.

I'm not sure you're right.

In my example,when we remove one object, we move back one position, i.e. the possibility of overshoot is eliminated.

P.S. Your way of course also works =)

 
Interesting >> :

Good day to you all!


I have an indicator with values ranging from 0 to 100. I want to prescribe in it some levels, including at trader's choice (I want to do 50 as a base).

How it can be written in the code?

indicator_levelN - horizontal N level in a separate indicator window, where N is from 1 to 8

This is what it looks like in the code:

#property indicatorlevel1 50

Add it at the beginning of the code

 
Fduch >> :

I'm not sure you're right.

In my example,when weremove one item, we move back one position, i.e. the possibility of overshoot is eliminated.

P.S. Your way of course also works =)

Yes indeed, didn't look closely at the example.

 

Good day all, could you please tell me how to write the values of two levels (picture attached). - High of the last green bar in AO (if the current red) and Low of the last red bar before the green. Thank you.
 

Подскажите пожалуйста кто нибудь:


How can the following implementation be achieved:


The daily chart indicator window should display the opening price at 3:00, is this even possible or not???

 

pomogite pls,

gde osibka?


extern double Risk=0.5;
extern int StopLoss=500;
extern int TakeProfit=50;
extern int Magic_N=12345;

int start()
{
if;
double bt=iCustom(NULL,0, "abracadabra",0,1);
double st=iCustom(NULL,0, "abracadabra",1,1);

for(int i=OrdersTotal()-1;i>=0;i--){
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)){
if(OrderSymbol()==Symbol() && (OrderType()==OP_BUY || OrderType()==OP_SELL)){
if(OrderType()==OP_BUY){
OrderClose(OrderTicket(),OrderLots(),Bid,0,Green);
}
if(OrderType()==OP_SELL){
OrderClose(OrderTicket(),OrderLots(),Ask,0,Red);
}
return(0);
}



spasibo
Reason: