Errors, bugs, questions - page 549

 

Dynamic Spread.TakeProfit did not work?

1.Why didn't Take Profit Sell 0.87909 on USDCHF 2011.10.25 01.55, Low=0.87869 triggered?
Declared spread 40 on USDCHF in Annex 1: Contract specifications.
2.Where can I find the current 2011.10.25 01.55 spread?
Automated Trading Championship 2011,
account 800153,
Sell order 6880592

 
Konstantin83:

After optimisation, the results file cannot be opened,

Build 527 + Office 2007

Error log contains the following data


XML error in "Table"
Cause: Erroneous value.
File: C:\Users\Dragon\Desktop\ReportOptimizer-957640.xml
Group: Cell
Tag: Data
Значение: 179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000

Will fix this shortly
 
ias:

Dynamic spread.TakeProfit didn't work?

1.Why did not Take Profit Sell 0.87909 on USDCHF 2011.10.25 01.55, Low=0.87869?
Declared spread 40 on USDCHF in Appendix 1: Contract specifications.
2.Where can I find the current 2011.10.25 01.55 spread?
Automated Trading Championship 2011,
account 800153,
Sell order 6880592

An example of an indicator showing the spread is given in the CopySpread() help. Specifically for this case the average spread was slightly more than 41 points (I used the indicator I found.), which means that the Bid price should have fallen by 42 points or more from TP=0.87909. Picture and indicator attached


Files:
 

Good afternoon . I am having trouble with three pine trees. Standard library MovingAverages, seems to be simple, but SimpleMA stubbornly returns 0. Here's a piece of code, everything works correctly tested with another code (the medium in the array).

for(i=ended ;i>=0 ;i--)
      {
         bbb=0 ;
         for( j=MaPeriod-1 ;j>=0 ;j--)
            {
               //bbb=bbb+price[i+j]-BaseMaBuffer[i+j]; 
               Raznica[j]=price[i+j]-BaseMaBuffer[i+j];
            }
         bbb=SimpleMA(0,MaPeriod,Raznica) ; 
         //MaForMaBuffer[i]=BaseMaBuffer[i]+bbb/MaPeriod;
         MaForMaBuffer[i]=BaseMaBuffer[i]+bbb; 
         MaForMaBuffer[Kol_vo-MaPeriod]=EMPTY_VALUE;  
      }
Документация по MQL5: Стандартная библиотека
Документация по MQL5: Стандартная библиотека
  • www.mql5.com
Стандартная библиотека - Документация по MQL5
 

Shouldn't this code compile?

class CClass1
  {
public:
   CClass1(void);
   ~CClass1(void);
   //--------
   const int val;
  };

CClass1::CClass1() : val(777)
  {
   
  }
 
WWer:

Shouldn't this code compile?

Tell me at once - what is the question?
 
Rosh:
Tell me at once - what is the question?

The initialisation of a constant member has to happen somewhere.

You probably can't initialize only constant members :) . It should also be a static member, for good reason.

 

Please give me a hint. Here is a piece of code

input double Lots=0.1 ;// используемый лот
input int    MaPeriod=10;// период расчета средней
input ENUM_MA_METHOD Metod=MODE_SMA ;// метод расчета Ма 
int Profit=20 ;//Профит в 4-х знаке
input  int EA_Magic=111 ;// магик
int TKP  ;
//---------------------------------------------------------------------------
int hOneMa ; //перменная для хранения хендла индикатора
double BaseMa[],MaForMa[] ;// массивы для хранения значения индикатора 
double p_close; // переменная для хранения значения close бара
//================================================================================================
int OnInit()
  {
      hOneMa=iCustom(NULL,0,"Учеба\\OneMa",MaPeriod,Metod) ;
      if (hOneMa <0 )
         {
            Alert("Ошибка при создании индикаторов - номер ошибки: ",GetLastError(),"!!");
         }
      //Alert("проверка вывода алерта в журнал ");
      TKP=Profit ;
     if (_Digits == 3 || _Digits==5)
      {
         TKP=TKP*10 ; 
      }
   return(0);
  }

What is the data type of Metod variable that can be passed into a function if Metod is not a global variable. Thank you .

Документация по MQL5: Основы языка / Типы данных
Документация по MQL5: Основы языка / Типы данных
  • www.mql5.com
Основы языка / Типы данных - Документация по MQL5
 
hOneMa=iCustom(NULL,0,"Учеба\\OneMa",MaPeriod,int( Metod)) ;
That should be OK.
 
WWer:

Shouldn't this code compile?

Add a destructor body, even if it is empty.
Reason: