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

 
why does the ROC indicator not actually take on a value less than "0", but does graphically?
 
vilard:
why does the ROC indicator not actually take on a value less than "0", but does graphically?

Which ROC? This one?
 
Roman.:

Which ROC? This one?

https://www.mql5.com/ru/code/9340
 

Hi all. Guys I have a condition to find max: but within a corridor.

For (int max=1; max<1000; max++)
if (High[max+1] < High[max] && High[max] > High[max-1] && Low[max+1] < Low[max] &&& Low[max] > Low[max-1] &&
High[max] > low_level_s && High[max] < high_level_s) break;

it does not work.
if I remove corridor All ok:

for (int max=1; max<1000; max++)
if (High[max+1] < High[max] && High[max] > High[max-1] && Low[max+1] < Low[max] && Low[max] > Low[max-1] ) break;

What could be the problem?

I understand that max<1000 should be increased, I tried it but it didn't work.

Here is an example in numbers:

1. 4100<1.4150<1.4200 but 1.4150 must fall

within low_level_s(1.4145), high_level_s(1.4155) . In this example it did.

But if it is not, let's assume that it is 1.4160, we will keep looking. The problem is that this high may be 3 years ago, for example. The program can not find it.

What to do? Maybe it is possible to get the quote archive?

 
vilard:

https://www.mql5.com/ru/code/9340

Look at my link - it's a basic variant with description of price rate indicator + EA based on it (iCustom() indicator succumbs). If you have other trading conditions for market entry, edit the existing ones and go ahead, everything tests fine, now myself, just finished testing it as a variant of thechanalysis (market entry filter), moreover there is a description and everything else... Edit it to suit your conditions and that's it. The Expert Advisor is here.
 
Roman.:

Look at my link - it's a basic variant with description of price rate indicator + EA based on it (iCustom() indicator lends itself). If you have other trading conditions for market entry, edit the existing ones and go ahead, everything is tested fine, now myself, just finished testing it as a variant of tehanalysis (market entry filter), moreover, there is a description and everything else... Edit it to suit your conditions and that's it. The Expert Advisor is here.

Thanks
 

Whew!!! The computer's gone down!!! It reacts with a delay, pops up wrong windows, doesn't delete, freezes... I've rebooted it 20 times, unplugged it.

Thank you.

Maybe it's a virus.

The users folder there is forty-five thousand megabytes, my God! And the sum of the folders it contains, the sum of what it contains, checking by clicking on the properties of the folder, does not give even thirtieth part.

It's not deleted!!! It's just slowing down, no swearing.

Nothing uploaded, nothing deleted, had a hard time deleting pictures and then a Ninja movie, the space added an edge like insignificant, a millimeter of red.

 
I have attached a Trailing Stop to this EA. Compiles at 0 and 0, but in the tester
Trailinstop does not work. Please advise how I should have entered it correctly

Trailingstop code.

extern double  lots    = 1,

               No_Loss              = 7,     //перевод в безубыток
               TrailingStop         = 12;     //тралл  

extern string P_Performanc0= "-- 1 --";

extern int TP1BUY   = 222,  
           SL1BUY   = 99999;   

extern string P_Performanc1= "-- 2 --";  

extern int TP2SELL  = 222,
           SL2SELL  = 99999;
           
extern string P_Performanc2= "-- 3 --";         
           
extern int TP3BUY   = 222,         
           SL3BUY   = 99999;

extern string P_Performanc3= "-- 4 --";   
           
extern int TP4SELL  = 222,
           SL4SELL  = 99999;          

extern string P_Performanc4= "-- 5 --";        
           
extern int TP5BUY   = 222,
           SL5BUY   = 99999;
           
extern string P_Performanc5= "-- 6 --";              
           
extern int TP6SELL  = 222,        
           SL6SELL  = 99999;
           
extern string P_Performanc6= "-- 7 --";              
           
extern int TP7BUY   = 222,
           SL7BUY   = 99999; 
           
extern string P_Performanc7= "-- 8 --";              
           
extern int TP8SELL  = 222,
           SL8SELL  = 99999;                   

           
int        last_bar = 0;

int start()
{
   if (TrailingStop!=0) TrailingStop(0,TrailingStop);
   if (No_Loss!=0)      TrailingStop(1,No_Loss);
   string Name;
   //-----------------------------------------------------------------------   
double StopLevel =MarketInfo(Symbol(),MODE_STOPLEVEL);  // текущий уровень стопов  
   if (last_bar == Bars) return(0);
   last_bar = Bars;
   if (OrdersTotal() == 0)
   {
OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-SL1BUY*Point,Ask+TP1BUY*Point);
OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-SL3BUY*Point,Ask+TP3BUY*Point);
OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-SL5BUY*Point,Ask+TP5BUY*Point);
OrderSend(Symbol(),OP_BUY,lots,Ask,3,Bid-SL7BUY*Point,Ask+TP7BUY*Point);

OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+SL2SELL*Point,Bid-TP2SELL*Point);
OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+SL4SELL*Point,Bid-TP4SELL*Point);
OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+SL6SELL*Point,Bid-TP6SELL*Point);
OrderSend(Symbol(),OP_SELL,lots,Bid,3,Ask+SL8SELL*Point,Bid-TP8SELL*Point);
   } 
   return(0);
}
void TrailingStop(int NL, int tral)
{
   int tip,Ticket;
   bool error;
   double StLo,OSL,OOP;
   for (int i=0; i<OrdersTotal(); i++) 
   {  if (OrderSelect(i, SELECT_BY_POS)==true)
      {  tip = OrderType();
         if (tip<8 && OrderSymbol()==Symbol())
         {
            OSL   = OrderStopLoss();
            OOP   = OrderOpenPrice();
            Ticket = OrderTicket();
            if (tip==OP_BUY)             
            {
               if (NL==1 && OSL>OOP) continue;
               StLo = NormalizeDouble(Bid - tral*Point,Digits); 
               if (StLo > OSL && StLo > OOP)
               {  error=OrderModify(Ticket,OOP,StLo,OrderTakeProfit(),0,White);
                  Comment("TrailingStop ",Ticket," ",TimeToStr(TimeCurrent(),TIME_MINUTES));
                  Sleep(500);
                  if (!error) Print(Symbol(),"   Error order ",Ticket," TrailingStop ",GetLastError());
               }
            }                                         
            if (tip==OP_SELL)        
            {
               if (NL==1 && (OSL<OOP&&OSL!=0)) continue;
               StLo = NormalizeDouble(Ask + tral*Point,Digits);
               if ((StLo < OSL||OSL==0) && StLo < OOP)
               {  error=OrderModify(Ticket,OOP,StLo,OrderTakeProfit(),0,White);
                  Comment("TrailingStop ",Ticket," ",TimeToStr(TimeCurrent(),TIME_MINUTES));
                  Sleep(500);
                  if (!error) Print(Symbol(),"   Error order ",Ticket," TrailingStop ",GetLastError());
               }
            } 
         }
      }
   }
}
//--------------------------------------------------------------------
 
Please tell me if it is possible to display different lines of the same indicator in different sub-windows of the chart. Thank you.
 
Open the indicator in two windows and set the unwanted line to the background colour.