[Qualsiasi domanda da principiante, per non ingombrare il forum. Professionisti, non passate oltre. Da nessuna parte senza di te - 4. - pagina 238

 
w_ersoc:

Grazie, l'ho visto, ma lì...

Non mi serve vicino al mercato ma vicino a un prezzo specifico.

Esempio: il mercato è a 1,3262 e ho bisogno di sapere entro 5 pip da 1,1111


Cosa vi impedisce di cambiare MODE_ASK qui a 1,1111 per un ordine di acquisto, diciamo? La funzione è pronta - modificala.

if (ot==OP_BUY || ot==OP_BUYLIMIT || ot==OP_BUYSTOP) {
            if (MathAbs(MarketInfo(sy, MODE_ASK)-OrderOpenPrice())<ds*p) return(True);
          }
          if (ot==OP_SELL || ot==OP_SELLLIMIT || ot==OP_SELLSTOP) {
            if (MathAbs(OrderOpenPrice()-MarketInfo(sy, MODE_BID))<ds*p) return(True);
 
Roman.:

Cosa vi impedisce di cambiare MODE_ASK qui a 1,1111 per un ordine di acquisto, diciamo? La funzione è pronta - modificala.


Grazie!
 
deyron:

Sopra un post sotto corretto. Non ci sono criteri (vuoti) per far passare un MA attraverso un altro e viceversa.

Il fatto stesso che se un buffer - senza domande, ma lo stesso attraverso il 2°, 3° o 4°, non viene trasmesso, o meglio non funziona.



Se c'è un buffer nell'indicatore, si dovrebbe fare di conseguenza
 
costy_:
gli indicatori non funzionano con uno slittamento, per non fermare il flusso commerciale!

Questo è il punto, l'indicatore funziona solo con lo slittamento e il "contatore vuoto", non disegna nulla senza di loro!!!!! È incredibile, stupefacente, incomprensibile, alla fine non è normale, ma ho dovuto scrivere il codice!
//+------------------------------------------------------------------+
//|                                                   Синяячерта.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 бар_начало;
 
 double Pustostsetscyk;
//+------------------------------------------------------------------+
//| 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++){ Pustostsetscyk++;} Pustostsetscyk=0;
         Sleep(4000);
     i=Bars;
       бар_вершина=iHighest( NULL,  timeframe, MODE_HIGH, i, start ) ;
       вершина =High[ бар_вершина ];
       бар_основание_первого_снижения=iLowest( NULL,  timeframe, MODE_LOW, бар_вершина, start ) ;
       основание_первого_снижения=Low[ бар_основание_первого_снижения ];
       бар_начало=iLowest( NULL,  timeframe, MODE_LOW, бар_вершина*2, бар_вершина ) ;
       начало=Low[ бар_начало ];
       Sleep(4000);
      //   Alert ( " бар_вершина   ",бар_вершина  , " вершина  " , вершина ,
      //    " бар_основание_первого_снижения  " ,бар_основание_первого_снижения  , " основание_первого_снижения  " , основание_первого_снижения , 
      //    " бар_начало  " , бар_начало   , " начало  " , начало    );
  
    НижняячертаBuffer2[бар_начало]=начало;
    НижняячертаBuffer2[бар_основание_первого_снижения]=основание_первого_снижения;
    for ( i=0;i<10;i++){  НижняячертаBuffer2[i]= Open[i];}
     Sleep(4000);     
    for (i=0;i<500;i++){ Pustostsetscyk++;}   Pustostsetscyk=0;   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

E il tempo non può essere cambiato, tutto sparisce per sempre.

Ho dovuto aggiungere una linea per (i=0;i<300;i++){ Alert ( Bottom lineBuffer2[i]); }, non disegna senza!

E attira davvero ogni tanto! Così ho impostato lo spessore della linea a 4, l'ho compilato, e no!!!

Ho appena messo l 'indicatore sul grafico, non c'è. Aspetto due minuti e non c'è più. Senza rimuoverlo dal grafico, compilo nuovamente lo stesso codice nell'editor di Metatrader.

 
Dimka-novitsek:

Questo è il punto, l'indicatore funziona solo con slittamento e "contatore vuoto", non disegna nulla senza di loro!!!!! È incredibile, stupefacente, incomprensibile, alla fine non è normale, ma ho dovuto scrivere il codice!


Inizia con questo.

//+------------------------------------------------------------------+
//|                                                   Синяячерта.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 BufferUP[];
double BufferDN[];
double BufferBlue[];

 
 double Pustostsetscyk;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
SetIndexStyle(0,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(0,BufferUP);//Alert ("SetIndexBuffer ",GetLastError( ) );
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(1,BufferDN);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(1,0.0);
   
   SetIndexStyle(2,DRAW_LINE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,BufferBlue);//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();
//----
   int limit=Bars-counted_bars-1;

   for (int i=limit;i>=0;i--) {
      BufferBlue[i]  = Open[i];
      BufferUP[i]    = High[i];
      BufferDN[i]    = Low[i];
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
 

Grazie!!!!!!

Grande!!!

 
Dimka-novitsek:
Grazie!!!!!!

Leggermente corretto il post precedente
 
Sapete, quando cambiate timeframe scompare anche, e in modo permanente, non si mostra più su nessun timeframe. Beh, cercherò di fare qualcosa di utile per cominciare. Credo che il mio computer si stia cancellando o qualcosa del genere.
 
Dimka-novitsek:
Sapete, quando cambiate timeframe scompare anche, e in modo permanente, non si mostra più su nessun timeframe. Beh, cercherò di fare qualcosa di utile per cominciare. Credo che il mio computer si stia cancellando o qualcosa del genere.

Ho sistemato un po' il codice, ho già scritto
Motivazione: