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

 
Dimka-novitsek:

Here, let's say the blue line. Init- SetIndexStyle(2,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE); //Alert ("SetIndexStyle ",GetLastError( ) );
SetIndexBuffer(2,BlueBuffer3); //Alert ("SetIndexBuffer ",GetLastError( );
SetIndexEmptyValue(2,0.0);

Start- for (i=0;i<100;i++) { BlueBuffer3[i]= Open[i];}
for (i=330;i<500;i++) { BlueBuffer3[i]= Open[i];}

It's like, how much easier!!!

And what do you have in place of the X here:
#property indicator_buffers X?

If it's less than three, you can't see shit!

 
That's right!!!!!!!!!!!!!!!!! I added a line for (i=0;i<500;i++){ Alert (BlueBuffer3[i]);} it scribbles!!!!!!!! But so it signals, I deleted this line, compiled it - it doesn't draw anything!!!!! Did you get it? I added the line again and it scribbles again, but it also has a signal!!!! I closed the line. // It doesn't do anything!!!! The line doesn't do anything, maybe it just slows down the time. So how do I know? How do I update the indicator and how do I deal with it?
//+------------------------------------------------------------------+
//|                                                   Синяячерта.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Green
#property indicator_color2 Red
#property indicator_color3 DarkBlue

double ВерхняячертаBuffer1[];
double НижняячертаBuffer2[];
double СинняячертаBuffer3[];
 double вершина; 
 double основание_первого_снижения;
 double начало;
 double вершина_волны_3;
 
 int timeframe, start ;
 int бар_вершина ;
 int бар_основание_первого_снижения;
 int бар_начало;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexStyle(0,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(0,ВерхняячертаBuffer1);//Alert ("SetIndexBuffer ",GetLastError( ) );
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(1,НижняячертаBuffer2);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(1,0.0);
   
   SetIndexStyle(2,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,СинняячертаBuffer3);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(2,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   for (int i=0;i<100;i++){  СинняячертаBuffer3[i]= Open[i];}
          for (i=330;i<500;i++){  СинняячертаBuffer3[i]= Open[i];}
         for (i=0;i<500;i++){ Alert (СинняячертаBuffer3[i]);}
          
          
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

In general, it draws as it pleases!!! not on all currency pairs, or it suddenly disappears when you change timeframe!!! (that's the one I posted above). This one too.

Actually I'm satisfied with lines themselves - they are as I wanted, i.e. it follows clearly from the code, where they should be colored, but I'll probably make colours brighter for further.

 

Dear Sirs, help us out please!!! How to fill pending orders e.g. through a tick, a certain price interval.

 
If I understand correctly, it's like this, in its simplest form. Well, something like that, something like that.
//+------------------------------------------------------------------+
//|                                                    байбаевий.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

extern int kolitsestvo=1;
   extern double lot=0.01;
extern int Skolko_orderov      = 5;     

extern int Rasstojanie    =5;        
                                    
extern double Natscalo      =5;     

extern double teykprofit=12;

extern int magic=600;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
         int schet=0;
int start()
  { 
//----
 if(schet<kolitsestvo){schet++;
   for(int i=1;i<=Skolko_orderov;i++)
               {
                
               
                  OrderSend(Symbol(),OP_BUYSTOP,lot,NormalizeDouble(Bid+Natscalo*Point+i*Rasstojanie*Point,Digits),3,0,NormalizeDouble(Bid+Natscalo*Point+i*Rasstojanie*Point+(teykprofit*Point),Digits),"",magic,0,Red);     
               }           }
//----
   return(0);
  }
//+------------------------------------------------------------------+
Or did you mean something else?
 
Man, it's so easy, I'll try it later. thanks a lot!
 

I've encountered this problem: The EA writes a huge log file when testing. During the day of testing it accumulated 150 GB. That's too much))))

Can you please advise whether you can put a ban on writing the log file in the Expert Advisor?

 

Brothers, help!

I am writing my first Expert Advisor and I have no idea where and what I did wrong.

Ticket = OrderSend(Symbol(), 0, Lots_New, Ask, 10, NormalizeDouble(Stop, Digits),

NormalizeDouble(Take, Digits), NULL, Magic, 0, Blue);

I try to open an order. I get a persistent error of 130. I print values Ask=1,22908, Stop=1,22808, Take=1,23010 (my stop and take are 10.0 points).

What's wrong?????

Thanks in advance!

 
Top2n:
Man, it's so easy, I'll try later. thank you so much!

You're welcome!!!
 
Well, I don't know. Try 11pts instead of 10pts, though it shouldn't. Or maybe it should, depending on the pair, broker, try it in general. Or even 50 pips, you will see where the dog is hidden. Or even 200 pips.
Reason: