Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 787

 
evillive:
In the loop, increment the counter on each of his pending orders and remember the ticket, if the counter after the loop = 1 then delete the order with this ticket.

Thank you, we will try

 
evillive:
In the loop, increment the counter on each of my pending orders and store the ticket, if the counter after the loop = 1, then delete the order with this ticket.
Is it possible to do without the ticket? When I update the EA in the terminal, I want to be sure that it will pick up its orders, because this EA is already trading.
 
woin2110:
Is it possible to do without a ticket? When I update the EA in the terminal, I want to be sure that it will pick up its orders, because this EA is already trading.
Well, the ticket will be your order
 
#property indicator_chart_window
#property indicator_buffers 3
#property  indicator_color1 Magenta
#property  indicator_color2 Aqua
//--- input parameters
extern int       Period_=15;
extern double    Rmax   =0.005;
//--- buffers
double Max[];
double RazmahMax[];
double BufferLow[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(3);
   SetIndexBuffer(2,BufferLow);
   SetIndexBuffer(1,Max);
   SetIndexBuffer(0,RazmahMax);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,226);
   SetIndexEmptyValue(0,0.0);
   IndicatorDigits(Digits+1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
    int counted_bars=IndicatorCounted(),limit, i,m;
    double maximum,spuskMax;
   if(counted_bars>0)
      counted_bars--;  
   limit=Bars-counted_bars;
   for(i=0;i<limit;i++)
   {
      maximum=High[iHighest(NULL,0,MODE_HIGH,Period_,i)];
      Max[i]=maximum;//найден максимум
   }
   for(i=0;i<limit;i++)
   {
   spuskMax=Max[i]-Low[i];//разница между максимумом и текущим минимумом
   BufferLow[i]=spuskMax;
   }
   for(i=0;i<limit;i++)
   {
   m=iHighest(NULL,0,MODE_HIGH,Period_,i);//индекс на котором находится максимум
   if (BufferLow[i] > Rmax){RazmahMax[i+m]=High[i+m];}//поставить стрелку на баре где находится максимум
   if (BufferLow[i] < Rmax){RazmahMax[i+m]=0.0;}
   }
   return(0);
  }

The question has not been dismissed. So, first of all.

A maximum is found, then a line is plotted against it. The distance between this maximum line and the current minimum is checked. If it exceeds "Rmax", an arrow is set on the bar where the maximum is found. The arrow is placed but not there. For clarity, added buffer "BufferLow[i]", which shows the difference and its data is visible in the browser window.

 

Good evening all!

I'm studying the topic of creating and initializing an array.

In principle, I understand everything.

Even managed to initialize an array consisting of price values.

I initialized it like this....

-copied it into an Excel table

-Spaced commas after each value

-and then transferred it to the include file.

QUESTION

How can I initialize an array more quickly and with the help of MQ4?

Thank you.

173.252
173.370
173.072
173.080
172.782
172.870
172.572
172.720
173.722
172.250
171.952
171.850
171.552
171.630
171.332
170.730
171.732
172.192
172.490
172.370
172.072
 
AlexeyVik:

StringConcatenate will help.

Thank you.
 

Dear colleagues!

I have a statistical trading strategy. There is a database of TS signals for almost three years. It is compiled in a table in Excel consisting of five columns of digits and one column of letters, which reflects the deal on the signal - the actual buying or selling ("B" or "H"). The problem is with filtering these signals. It is physically impossible to determine correctly the direction using an ordinary filter. Or rather, you can, but it will take a lot of time (I spent more than an hour while preparing this post, in market conditions for the adopted strategy it is a catastrophic lot). And if you limit yourself to taking not all possible variants of filtering, you will encounter filtering errors. The result is profits on paper, but de facto losses.

Below I give a table - the basis for automatic filtering (as I see it). This table must be linked to the database of statistics. I only have to enter the necessary numbers in the first line of the table and the agency gives me as a result of probability of purchase and sale, well, I have these data to decide - to trade or not (if I am not satisfied with the probability).

filter

If anyone has a desire and ability to help - would be grateful. Possible payment within a reasonable limit. You can discuss the details in person.

 
sivanik:

Dear colleagues!

I have a statistical trading strategy. There is a database of TS signals for almost three years. It is compiled in a table in Excel consisting of five columns of digits and one column of letters, which reflects the deal on the signal - the actual buying or selling ("B" or "H"). The problem is with filtering these signals. It is physically impossible to determine correctly the direction using an ordinary filter. Or rather, you can, but it will take a lot of time (I spent more than an hour while preparing this post, in market conditions for the adopted strategy it is a catastrophic lot). And if you limit yourself to taking not all possible variants of filtering, you will encounter filtering errors. The result is profits on paper, but de facto losses.

Below I give a table - the basis for automatic filtering (as I see it). This table must be linked to the database of statistics. I just need to enter in the first line of the table needed numbers and the agency gives me in the end, the probability of buying and selling, well, I have these data to decide - to trade or not (if I am not satisfied with the probability).


If you have the desire and ability to help - I would be grateful. Possible payment within a reasonable range. Can discuss the details in person.

And please tell me, what is the profit from such a complex structure? In general, is there a point in doing it? After all, if the output is 100% but only 3 times a year, then with 60% probability 3 times a day will give you more income than that 100%... Of course the example above is exaggerated, but not too far from reality.

Here is an example of a dumb trade No indicators or any other research, and 15% to the deposit for a week give suds...

Well, if there is Freelance or the private of any programmer.

 
AlexeyVik:

And please tell me, what is the income from such a complex design? In general, is there a point in doing it? After all, if in the end the output 100% but only 3 times a year, then with a probability of 60% 3 times a day will give more income than that 100% ... Of course the example above is exaggerated, but not too far from reality.

Here is an example of a dumb trade No indicators or any other research, but 15% to the deposit in a week give suds...

Well, if so, there is Freelance or the personal account of any programmer.

Thanks for the link. I've ordered an indicator there once before, I just forgot where I did it!

As for the TS. The statistics are roughly as follows. On the average about 40 trades per month. In pips about 2500-3000 points. (Points, not pips! Or 25-30 pips) With proper filtration the percentage of losing trades does not exceed 10%. I`ve never used third-party tools (Expert Advisors not for my TS) and I`m not going to do it! Thanks for the offer!

 

good day!!! friends! comrades! respect to you pros!!!

i need help!!! My eyes are puffy, my head hurts, i can't prescribe it so my EA has moved StopLoss to the specified points in profit at the current price!!!

That is, when the price moved to a given point, StopLoss moved there!!!

my example does not fit.

#define  MagicNumber  123

////extern double TakeProfit   = 50; //Тейкпрофит ордера
extern double StopLoss     = 50; //Стоплосс ордера  
extern int    Delta        = 100;  //Расстояние от цены для установки ордера
extern int    Expiration   = 100;    //Время истечения ордера
extern double Lot          = 0.01;    //Объём позиции
extern int    TrailingLevel = 200;   //уровень
extern int    TrailingStep  = 200;


int            last_bar       = 0;
  
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start(){

for (int i=0; i<OrdersTotal(); i++) {
      if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES))

           if (OrderType() == OP_BUY) { 
 if ((OrderStopLoss() < (Bid - TrailingLevel * Point - TrailingStep * Point)) || (OrderStopLoss() == 0)) { // 2
          bool res=OrderModify(OrderTicket(),OrderOpenPrice(),(Bid - TrailingLevel * Point),OrderTakeProfit(),0,Green);   
}
}
}
  
 datetime expiration = TimeCurrent()+3600*Expiration; /// время окончания  
   double BUYLIMITPrice=Ask-Delta*Point; /// это пункты BUYLIMIT

 if (last_bar == Bars) return(0) ;
  last_bar = Bars;
   if (OrdersTotal() == 0)
     {
int ticket=OrderSend(Symbol(),OP_BUYLIMIT,Lot, BUYLIMITPrice,0, BUYLIMITPrice-StopLoss*Point,0 ,"",MagicNumber,expiration,clrNONE);/// это BUYLIMIT
}
 
//----
  return(0) ; 
 } 
  
  
//-- ------------------------------------------------------------------


Reason: