[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 254

 
Dimka-novitsek:

To express the number of points, you must divide by Point. This seems to be a so-called predefined variable, which is the size of a single point. Oh, no, no, that's not it. Let's say you have a certain price value, let's say 1.2244. If you want to add 5 points to the price, you have to write it as 1.2244+(5*Point), it will be 1.2249. Do you understand?


It all makes sense now, thank you very much!
 

I can't insert a function into the turkey. (' - Function for determining unexpected C:. \ Ò The \experimental \ indicator \IndexDiamond mq4 (142, 19)

What is he missing? '(' - function definition unexpected C:\Òterminalëë\experts\indicators\ÈäþêÄèìîínà .mq4 (142, 19)

//+------------------------------------------------------------------+
//|                                                 ИндюкДимона .mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#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
#import "user32.dll"
   int   PostMessageA(int  hWnd,int  Msg,int  wParam,string lParam);
#import
#define WM_COMMAND                     0x0111
int delimiter = 0;



double ВерхняячертаBuffer1[];
double НижняячертаBuffer2[];
double СинняячертаBuffer3[];
 double вершина; 
 double основание_первого_снижения;
 double начало;
 double вершина_волны_3;
 extern int T=4,K=200;
 int timeframe, start ;
 int бар_вершина ;
 int бар_основание_первого_снижения;
 int бар_начало;
 int pereklutsatel;
double naklon,linija2; int P;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()

  {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,T,CLR_NONE);//Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(2,СинняячертаBuffer3);//Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(2,0.0);
//---- indicators




//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   
   for ( int J=0;J<=49;J++){
//----

  // for(int i=Bars; i>=0;i--)
  int i=Bars;
      бар_вершина=iHighest( NULL,  timeframe, MODE_HIGH, K, start ) ;
       вершина =High[ бар_вершина ];
       бар_основание_первого_снижения=iLowest( NULL,  timeframe, MODE_LOW,NormalizeDouble ( бар_вершина/2,0), start ) ;
       основание_первого_снижения=Low[ бар_основание_первого_снижения ];
       бар_начало=iLowest( NULL,  timeframe, MODE_LOW,NormalizeDouble (бар_вершина*1.5,0), бар_вершина ) ;
       начало=Low[ бар_начало ];
       
      //   Alert ( " бар_вершина   ",бар_вершина  , " вершина  " , вершина ,
      //    " бар_основание_первого_снижения  " ,бар_основание_первого_снижения  , " основание_первого_снижения  " , основание_первого_снижения , 
      //    " бар_начало  " , бар_начало   , " начало  " , начало    );
  if(начало>основание_первого_снижения){naklon=(начало-основание_первого_снижения)/(бар_начало-бар_основание_первого_снижения);
 // Alert("naklon  ", naklon);
    НижняячертаBuffer2[бар_начало]=начало;linija2=начало;for(i=бар_начало-1;i>=0;i--){linija2=linija2-naklon;
  //  Alert ("linija2  " , linija2 );
    НижняячертаBuffer2[i]=linija2;
   //  Alert("НижняячертаBuffer2[i]  ", НижняячертаBuffer2[i] , "  i " , i);
   }
    НижняячертаBuffer2[бар_основание_первого_снижения]=основание_первого_снижения;}
    
    
         for (i=0;i<100;i++){  СинняячертаBuffer3[i]= Open[i];}
          for (i=330;i<500;i++){  СинняячертаBuffer3[i]= Open[i];}

     ВерхняячертаBuffer1[бар_начало]=начало;
     
 double точка4; int бар_точка4;   бар_точка4=iHighest( NULL,  timeframe, MODE_HIGH, бар_основание_первого_снижения, 3 ) ; 
  точка4 =High[ бар_точка4 ];  
   
   if(вершина>точка4){naklon=(начало-точка4)/(бар_начало-бар_точка4);  
   double linija1=начало;for(i=бар_начало-1;i>=0;i--){linija1=linija1-naklon;ВерхняячертаBuffer1[i]=linija1; }}
   
 double vulf=НижняячертаBuffer2[0];
  if ( vulf==Ask&&vulf==Bid)vulf=1;
  else{ for (vulf=vulf+Point*10; vulf==НижняячертаBuffer2[0];vulf=vulf-Point){
           if ( vulf==Ask&&vulf==Bid){vulf=1;}} 
      for (vulf=vulf-Point*10; vulf==НижняячертаBuffer2[0];vulf=vulf+Point){
           if ( vulf==Ask&&vulf==Bid)vulf=1;} 
              
           
           
           }
           
           
   if (vulf==1){Comment ("  Есть вульв!!! "  , "  timeframe " , timeframe);return(0);  }
   
   if (vulf!=1&&pereklutsatel==1) {    
   
     if(delimiter<3){delimiter++;Comment(delimiter);return(0);}
   delimiter=0;
    fChangePeriod();P++;
                                 
                   }  
 if (P>8){  K=K+50;return(0);P=0; }    
//----
   return(0);
  }
//+------------------------------------------------------------------+


void fChangePeriod(){int ii,hwd = WindowHandle(Symbol(),Period());
   switch(Period()){
      case PERIOD_W1    : ii = 33134; break; //PERIOD_D1;
      case PERIOD_D1    : ii = 33136; break; //PERIOD_H4;
      case PERIOD_H4    : ii = 33135; break; //PERIOD_H1;
      case PERIOD_H1    : ii = 33140; break; //PERIOD_M30;
      case PERIOD_M30   : ii = 33139; break; //PERIOD_M15;
      case PERIOD_M15   : ii = 33138; break; //PERIOD_M5;
      case PERIOD_M5    : ii = 33137; break; //PERIOD_M1;
      case PERIOD_M1    : ii = 33141; break; //PERIOD_W1;
   }     
   PostMessageA(hwd, WM_COMMAND, ii, 0);
   return;
}
 
Can you tell me if there is already an indicator that calculates the index (basket) of currencies as a percentage?
for example from
Euro 37.4
Japanese yen 9.4
Pound sterling 11.3
U.S. dollar 41.9
 

Hi folks, could you please tell a newbie how the "mikahekin" indicator changes the displayed buffer? And how do I get the "Alert" function to shout out when the trend is changing?

P.S. The indicator is below.

Files:
 

Tell me, is it possible to crack a file with the extension ex4, which is on the password. And what else can be done besides the password written in the tutorial Kovalev, so that the expert is not hacked (if possible, of course) ?

Thank you.

 
Skander:

_ And what else can be done besides the password written in Kovalev's tutorial to prevent the expert from being hacked (of course, if it is possible) ?

Let them break in. It does not matter. No Expert Advisor will change the market, and everyone in the market cannot make money, it is not possible.
 
Skander:

Tell me if it is possible to crack a file with the extension ex4 that is on the password.

you can.
 

Hello, Professionals! Please advise me, I've been testing the Moving Average Expert Advisor, but after the weekend the tester gives error 131 wrong volumes... but before that everything was fine... I've been testing with a platform from MetaQuotes Software Corp.

 
Zhunko:

This script works for me:

This expert works strangely. You could say it doesn't work. It switches the TF on itself only up to M5.

I'll wait for the real ticks. I do not understand how the problem appeared. Something has changed in the new builds of MT4.

I have messed up with Expert Advisor code. The looped EA will switch the TF by itself, but the code is too cumbersome.

It could be simpler. This is for those who have access to autonomous update of the chart (it will work on Saturday and Sunday):

#include <ServicesMT4.mqh>
int g_hwndChart = NULL;
int g_nCounter = 0;

void init()
 {
  g_hwndChart = WindowHandle(Symbol(), Period()); // Получаем системный дескриптор графика.
  if (UninitializeReason() == 0) ServiceRefreshChart(g_hwndChart, 2000); // Запускаем обновление графика каждые 2 секунды.
 }

void deinit()
 {
  if (UninitializeReason() == REASON_REMOVE || UninitializeReason() == REASON_CHARTCLOSE)
   {
    ServiceStopRefreshChart(g_hwndChart); // Останавливаем обновление.
   }
 }

void start()
 {
  ServiceSetTimeframeByNumber(g_hwndChart, g_nCounter % 9);
  g_nCounter++;
  Sleep(2000);
 }
This is for those who can't access offline chart updates:
#include <ServicesMT4.mqh>
int g_hwndChart = NULL;
int g_nCounter = 0;

void init()
 {
  g_hwndChart = WindowHandle(Symbol(), Period()); // Получаем системный дескриптор графика.
 }

void start()
 {
  ServiceSetTimeframeByNumber(g_hwndChart, g_nCounter % 9);
  g_nCounter++;
  Sleep(2000);
 }

Or like this:

#include <ServicesMT4.mqh>
int g_nCounter = 0;

void start()
 {
  ServiceSetTimeframeByNumber(WindowHandle(Symbol(),Period()), g_nCounter % 9);
  g_nCounter++;
  Sleep(2000);
 }

Well, what do you think, Rustam? Has anyone here for the last 2 days shown the code of TF switching in Expert Advisor? You think you are a pro, but you couldn't figure it out. You couldn't see the error in a simple code. But you managed to praise someone else's development.

Reason: