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

 
Can you tell me how to make the indicator window close at the command of the indicator itself, like end of work? Is it possible?
 
akuma_san1:

I don't know what to do with it. You probably did not look at the picture, i understand everything you said and i support it. But the point of the question is not whether the entry point is max or min * by 0.25 from this max or min. How to describe it in an EA so that the EA has defined max and min and therefore an entry point?????

Any indicator has buffers from which you get the values you need. If you are interested in a specific indicator and entry points based on it, write your question in relation to a specific indicator and they will explain and show you the code as an example. Then, by analogy, you will be able to do what you need with any indicator. Unfortunately, I'm not at home now and I cannot show you more concretely on the example of a makdak, for example...

ZS. I looked at the picture - it's all the same vague... :)

 
cyclik33:

Gentlemen programmers, please advise me what to put in the EA to make it trade only 1 time on 1 bar.

I am very grateful in advance.

New Bar Opening Control
 
gosar:
Decided to install pipsolov3-don't know how to copy the indicators.Who can advise.Thanks in advance.

C:\Program Files\MT folder/experts/indicators
 
ToLik_SRGV:

At the very beginning of the start function, add a call line to this function:

The advisor will be activated 1 time, only on a new bar.

THANKS A LOT!!!
 

I want to add an additional condition in my EA to open a position using ADX indicator. Please advise how to write the condition correctly so it works as follows: if the previous value of ADX is more than the current one, then sit, if less, then buy

Thank you in advance for your help.

Thank you very much

 
FoxUA:

People help to release this operator at least who knows what and how can help

What list are you going to select an order from? It should open with the same values as the closed one? What is the definition of stop or take?
 
artmedia70:
From which list are you going to select an order? Does it have to open with the same values as the closed one? What is the purpose of specifying stop or take?

I have already made it, but I can't make it modifiable constants, it saves an order from the list, but the fact is the variables stay and it fills a new order on every tick,

how to make it reset values to zero when an order is opened until the next close

int mag;

int start()
{
bool b,s, //соответственно бай или селл  
bs,// если закрытие по стоплоссу ордера бай
ss,// если закрытие по стоплоссу ордера sell
bt,
st;//      то же по ТП
double bl,sl; // лоты соответсвенно для бай и селл


for(int cnt=OrdersHistoryTotal();cnt>0;cnt--)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_HISTORY);
         {if(OrderMagicNumber()== mag &&
          OrderSymbol()==Symbol()) 
            { if (OrderType() == OP_BUY )  {b=1; if (OrderClosePrice()==OrderTakeProfit()) bt=1; 
if (OrderClosePrice()==OrderStopLoss()) bs=1; bl=OrderLots()*10; break;}
              if (OrderType() == OP_SELL)  {s=1; if (OrderClosePrice()==OrderTakeProfit()) st=1; 
if (OrderClosePrice()==OrderStopLoss()) ss=1; sl=OrderLots()*10; break;}
            }
         }
      }


}//end
 
profitinvesting:

I want to add an additional condition in my EA to open a position using ADX indicator. Please tell me how to write the condition correctly so it works as follows: if the previous value of ADX is more than the current one, then sit if less, then buy

Thank you in advance for your help.

Thank you very much.

Compare the ADX value on the current bar (preferably the first bar) with the ADX value on the previous bar (preferably the second bar).

If outright it looks like this:

if (iADX(NULL,PERIOD_D1,14,PRICE_CLOSE,MODE_MAIN,1)>iADX(NULL,PERIOD_D1,14,PRICE_CLOSE,MODE_MAIN,2)) 
     {Действия, если значение ADX на 1-м баре больше чем на 2-м}
else 
if (iADX(NULL,PERIOD_D1,14,PRICE_CLOSE,MODE_MAIN,1)<iADX(NULL,PERIOD_D1,14,PRICE_CLOSE,MODE_MAIN,2)) 
     {Действия, если значение ADX на 1-м баре меньше чем на 2-м}
But it's not nice this way. It's better to assign ADX values to double variables and work further with variables...
 
FoxUA:

I have already made it, but I can't make it modifiable constants,

how to make it reset values to zero when an order is opened until the next close

The Boolean variables are not initially initialized to false, in general, before entering the loop, set them to zero (false) - when the loop exits, they will have the values assigned to them in the loop (better true than 1) and they will continue to have these values until the next entry into the loop. If the opening of an order strictly depends on the values of these variables, then, after the order to open an order, check the presence of this position in the market, and if it is present, set the variables to zero (false)
Reason: