Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 273

 
Barbarian:

Thank you, Vadim :) I understand the direction, I want to implement it in MQL4 without dll.

It will not work.
 

double bb_up0=iBands(NULL,0,bb_p,bb_dev,0, bb_ap,MODE_UPPER,0);

double bb_lo0=iBands(NULL,0,bb_p,bb_dev,0, bb_ap,MODE_LOWER,0);

//--- Gentlemen, Bollinger Bands middle line, below, are these all correct choices or are there wrong ones? In MT5 the middle line issue is worked out, I haven't seen it in MT4.

If you check with Alert script, the results are the same, but still?

double bb_bs0= (bb_up0+ bb_lo0)/2;

double bb_bs0= iMA(NULL,0,bb_p, 0,0,bb_ap, 0);

double bb_bs0= iBands(NULL,0,bb_p,bb_dev,0, bb_ap,MODE_MAIN, 0);

double bb_bs0= iBands(NULL,0,bb_p,bb_dev,0, bb_ap,0, 0);

 
Zhunko:
It won't.

Yes, I've already realised that it won't work without a dll.

 
rosomah:

double bb_up0=iBands(NULL,0,bb_p,bb_dev,0, bb_ap,MODE_UPPER,0);

double bb_lo0=iBands(NULL,0,bb_p,bb_dev,0, bb_ap,MODE_LOWER,0);

//--- Gentlemen, the Bollinger Bands mean line, below, are these all correct choices or are there wrong ones? MT5 has the middle line issue worked out, I haven't seen it in MT4.

If you check with Alert script, the results are the same, but still?

double bb_bs0= (bb_up0+ bb_lo0)/2;

double bb_bs0= iMA(NULL,0,bb_p, 0,0,bb_ap, 0);

double bb_bs0= iBands(NULL,0,bb_p,bb_dev,0, bb_ap,MODE_MAIN, 0);

double bb_bs0= iBands(NULL,0,bb_p,bb_dev,0, bb_ap,0, 0);

Here is the main cycle of BB construction:

//--- main cycle
   for(i=pos; i<rates_total && !IsStopped(); i++)
     {
      //--- middle line
      ExtMovingBuffer[i]=SimpleMA(i,InpBandsPeriod,close);
      //--- calculate and write down StdDev
      ExtStdDevBuffer[i]=StdDev_Func(i,close,ExtMovingBuffer,InpBandsPeriod);
      //--- upper line
      ExtUpperBuffer[i]=ExtMovingBuffer[i]+InpBandsDeviations*ExtStdDevBuffer[i];
      //--- lower line
      ExtLowerBuffer[i]=ExtMovingBuffer[i]-InpBandsDeviations*ExtStdDevBuffer[i];
      //---
     }

Here's the calculation of a simple MA:

//+------------------------------------------------------------------+
//| Simple Moving Average                                            |
//+------------------------------------------------------------------+
double SimpleMA(const int position,const int period,const double &price[])
  {
//---
   double result=0.0;
//--- check position
   if(position>=period-1 && period>0)
     {
      //--- calculate value
      for(int i=0;i<period;i++) result+=price[position-i];
      result/=period;
     }
//---
   return(result);
  }
//+------------------------------------------------------------------+

As you can see, the central line is a simple MA on Close. The rest is based on it. So, draw your own conclusions.

SZZ. As a pamphlet for your further labours:

You set the average value as follows: double bb_bs0 = (bb_up0+ bb_lo0)/2;

But it's better to calculate it this way: double bb_bs0= (bb_up0+ bb_lo0)*0.5;

After all, multiplication is faster than division.

 
artmedia70:

Here is the main cycle for building a BB:

Here is the calculation of a simple MA:

As you can see, the centre line is a simple MA on Close. The rest is based on it. You may draw your own conclusions.

SZZ. As a pamphlet for your further work:

You set the average value as follows: double bb_bs0 = (bb_up0+ bb_lo0)/2;

But it's better to calculate it this way: double bb_bs0= (bb_up0+ bb_lo0)*0.5;

After all, multiplication is faster than division.



1.At the price of bollinger bands IMHO...

 
TWAP (not VWAP) who calculated it? How is it calculated? I don't understand a thing from the explanations on the internet...
 
Barbarian:

Yes, I've already realised it won't work without a dll


Justify.
 

I've noticed a strange thing now. There's a base library that imports other libraries. Here's a piece of it:

//+---------------------------------------------------------------------------------------------------------------------------------------+
//| Библиотека базовых функций.                                                                                                           |
//+---------------------------------------------------------------------------------------------------------------------------------------+
// ================================================== Включения и импорт внешних модулей =================================================+
#include <hoz_Base@Include.mqh>
//+---
#import "hoz_LoggingToAnyWere@library.ex4"
    void fWrite_Log (string fs_Txt);
    void fPrint (string fs_Text);
#import
//+---
#import "hoz_HandlingWithErrorS@library.ex4"
    bool fErrorHandling (int fi_Error, bool& fb_InvalidSTOP);
    void fReConnect();
    string fErrorToString (int fi_Error);
    string fErrorDescription (int fi_Error);
#import
//+---
#import "hoz_ReturningSomeInfo@library.ex4"
    string fGet_NameOP (int fi_Type);
    string fGet_NameTF (int fi_TF = 0);
#import

When I start owl, which I am writing now with these libraries, I see in the log:

2013.11.23 16:15:51     2012.01.01 22:00  hoz_ReturningSomeInfo@library EURUSD,M5: loaded successfully
2013.11.23 16:15:51     2012.01.01 22:00  hoz_Base@Library EURUSD,M5: loaded successfully
2013.11.23 16:15:51     ExperT inputs: i_MAXSpread=50; i_Lot=0.1; i_KLot=2; i_SL=0; i_TP=10; i_Slippage=3; i_NumberOfTry=10; i_DistanceFromLastPos=10; i_TriggerForBU=25; i_PreservedProfit=5; TStop.Buy=70; TStop.Sell=10; TrailingStep=20; i_magic=3333021; 

I mean, according to the log, 2 libraries were loaded: hoz_ReturningSomeInfo@libraryand hoz_Base@Library.

But these libraries are missing: hoz_LoggingToAnyWere@library.ex4, hoz_HandlingWithErrorS@library.ex4 in the journal. Is it supposed to be like this? Or should all uploaded libraries be listed in the journal?

 
Integer:

Justify.

dll from winapi at least. to send char to window
 
artmedia70:

Here is the main cycle of the BB construction:

Here is the calculation of simple MA:

As you can see, the centre line is a simple MA on Close. The rest is based on it. You may draw your own conclusions.

SZY. As a pamphlet for your further labours:

You set the average value as follows: double bb_bs0 = (bb_up0+ bb_lo0)/2;

But it's better to calculate it this way: double bb_bs0= (bb_up0+ bb_lo0)*0.5;

After all, multiplication is faster than division.

Thanks, I didn't know that one in particular. And in BB, I used double bb_bs0= iBands(NULL,0,bb_p,bb_dev,0, bb_ap,MODE_MAIN, 0); until doubts took over, concerning MODE_MAIN.

But it works.

In the future I will use MA for the average.


Reason: