[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 341

 
dyxaa:

Exactly. Brilliantly simple))))

I need a buy stop if the price moves 100 pips down to delete it.

You put it programmatically or manually?

If manually, then close it manually (better).

If done programmatically (through an Expert Advisor), then go through the orders and find the right one. Then:

if (Bid < OrderOpenPrice()-100*Point) OrderDelete(OrderTicket());   // Это для Вашего типа ордера - Бай-Стоп

If you do not know how to do the overshoot and other simplest actions, then start by reading a tutorial on MCL. Because in this case, you are unlikely to be able to cope with the code.

 
hoz:

I have an idea, but how to do it in real life and how it will work reliably in real life, I don't really know.

The essence is as follows. We should enter the market after placing the owl on the chart immediately after the bar is closed, i.e. at the opening of a new bar. This is the first order. Further, when the order is closed by a TP or a Stop price, we should open an order at the opening of a new bar immediately. How to do it more reasonably?

I understand we should create a variable. Place the open price of the current bar in it. And compare this value with the opening price of the current bar. If the value of the variable is not equal to the opening price of the current bar with the index zero, we will open an order.

This is the most optimal variant, isn't it?

Here, I have encountered a function for determining the New Bar while solving my own cases:

//+------------------------------------------------------------------+
//|  Проверка на появление нового бара                               |
//+------------------------------------------------------------------+
bool isNewBar()
   {  static datetime TimeBar=0;
      bool flag=false;
      if(TimeBar!=Time[0])
         {
          TimeBar=Time[0];
          flag=true;
         } 
      return (flag);
   }
//+------------------------------------------------------------------+
Now all that's left is to open an order... : )))
 
dyxaa:

Exactly. Brilliantly simple))))

I need a buy stop if the price moves 100 pips down to delete it.

I have my own cross and I have to count 100 points by the difference between the price and the price for placing the pending order!
 

I don't understand what is wrong, help me understand, error 'start' - variable not defined, I need to find the maximum of RSI values for a certain period

(RSIBuffer3[i]) // array with RSI values

// define the array size

int count=ArraySize(RSIBuffer3[i]);

// search for the maximal value of the array

int RSI_max=ArrayMiximum (RSIBuffer3[i], count-1, int start=0);

 
Chiripaha:

If implemented, it will work as reliably in real life as it does on the demo. But not the fact that it will be profitable.

You can implement it through the opening of a new bar. But you haven't formulated in which direction the bar opens, and under what conditions this side is determined.

You do not need to compare anything - simply open an order when a new bar appears (based on your input) and that's it.

If you have no idea:

"Experience is the son of many mistakes.
And a genius is a friend of paradoxes" (Alexander Sergeyevich speaking to you).

You need to make (write) an owl and check it experimentally. - I don't think anyone will write the owl for you (for free). To give you a hint is one thing. But to implement ideas (thoughts) is not help, but work.


I imagine everything. The idea is that the first order, if we use one or another function to determine the new bar, will open spontaneously, when the EA is attached to the chart as . at the moment of putting the EA on the chart, the variable storing the time of opening the bar will not be equal to the time of the current bar opening.. I thought I would just assign the time of opening of the current bar to the variable in the Inite and then, if this variable is equal to the time of opening of the current bar, I will not do anything further and, if it is not equal, I will run the open function. I thought it would be the most adequate variant or maybe I could do without the inite.

 
Merincool:

I don't understand what is wrong, help me understand, error 'start' - variable not defined, I need to find the maximum of RSI values for a certain period

(RSIBuffer3[i]) // array with RSI values

// define the array size

int count=ArraySize(RSIBuffer3[i]);

// search for the maximal value of the array

int RSI_max=ArrayMiximum (RSIBuffer3[i], count-1, int start=0);

// determine the array size

int count=ArraySize(RSIBuffer3);

// search for the maximal value of the array

int RSI_max=ArrayMiximum(RSIBuffer3, count-1, int start=0);

 

What do I need to write in the program shortcut to make the terminal start with a specific account?

 
Hello, there are 4 indicators and user try to write an Expert Advisor for it. The question is what you need to prescribe to get the price value for each indicator to not display 0, but still a number. i need just prescribe grammatically in icustom, i prescribe, but that does not work, here is the "set".
Files:
 
Elektronik, it seems to open with the last one you were working with.
 
palomnik:
Elektronik, it seems to open with the last one, at least I haven't seen any other.

I finish on the tester and start on the real one.