Question for connoisseurs - page 4

 

Good afternoon. Happy New Year, everyone!

If anyone is still able to respond, please clarify the question.

Expert Advisor works with all ticks.

But it is necessary to involve in the expert an inbuilt in MT4 indicator and "take readings from it" at prices OPEN!

I cannot do it. I did so:

bool isNewBar=false;//работу фильтра реализуем по ценам открытия
if ( ExpertBars !=Bars) { ExpertBars=Bars; isNewBar=true; }
if ( isNewBar) { //если есть новый бар
            //жжжжжжжжжжжжжжжжж - ФИЛЬТР от Leonid553 жжжжжжжжжжжжжжжжжжжжжжжжж
            //------заполняем массив значениями Force --------------------- -----
            double Force_array[30]; int  z=0; while ( z<30) {
            Force_array[ z]= iForce(NULL, 0, Force_period, MODE_SMMA,PRICE_CLOSE, z);
            z++; }  ArraySetAsSeries( Force_array,true);
            double MA_0=iMAOnArray( Force_array,0, MA_period, Shift,MODE_SMMA,0);
            double MA_1=iMAOnArray( Force_array,0, MA_period, Shift,MODE_SMMA,1);
            //----------------------------------------------------------------
            bool TradeSell = true;   if  ( MA_0 > Stop_lim)     TradeSell = false ;            
            bool TradeBuy = true;   if  ( MA_0 < (-1)* Stop_lim)  TradeBuy = false ;            
            //жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж 

Next, - follows

//-------------------end work for opening prices ------------------------------

Comment("\n", "MA_0=", MA_0, "_", "MA_1=",MA_1)

But the comment prints zeros in both variables.

True, those values "flash" for a fraction of a second when the bar is opened. But then zero again.

//----------------------------------------

How to implement an indicator on the opening prices in the EA, working with all ticks?

Please, advise?

 

disable new bar check/bypass, try isNewBar always true,
if it helps then find where the array comes in null
- initiation in function, initiation in start and generally put them in global

 

Thank you, Korey.

I have done things a little differently.

This is not how the OPENING PRICE block works:

bool isNewBar=false;//работу фильтра реализуем по ценам открытия
if ( ExpertBars !=Bars) { ExpertBars=Bars; isNewBar=true; }
if ( isNewBar) { //если есть новый бар
     .... .... ....}

but like this:

int start() {
  здесть работаем по всем тикам
.... .... ....

if(Time[0]== prevtime) return(0);//ждём появления нового бара
  prevtime = Time[0]; //если появился новый бар - 
  
StdDev_0 =iStdDev(NULL,0, StdDev_period,0,2,PRICE_CLOSE,0) ;
StdDev_1 =iStdDev(NULL,0, StdDev_period,0,2,PRICE_CLOSE,1) ;
Comment("StdDev_0=", StdDev_0, "_","StdDev_1=", StdDev_1);
  
//------------------------------------------------------------         
   }// если спред соответствует заданному
   
  
   return (0);
}
//---------------------------- конец функции старт-------------

The comment now displays the values of the indicator as I want - at opening prices.

These values can be used when working with Expert Advisors on all ticks.

However. Here is a new trouble.

The indicator shows only 4 decimal places.

That's not good enough for me. I need five.

But it's built-in.

What can you do?

 

Here 's the code for this inbuilt turntable. Have fun and don't forget whose copyright it is.

 
Chris_Brown >> :

Aha, here's an example:

double W[3][4];

ArrayResize(W,2)


The result will change from 3 to 2. How do we change the second dimension from 4 to 6?

--------

In MQL4, only the first dimension can be changed dynamically.

If you want to change other dimensions, you have to write your own or use this library.

 

Good evening everyone!

An unpleasant thing happened 20 minutes ago in MT4.

At the next launch it was found that all (all!) EAs disappeared from EXPERTS folder.

Even mounted! MA-SIPLE and MA !

All the other folders are still there. And the experts are not there...

THE INTERNET WAS ON !

I am generally very worried and perplexed !

The experts are nowhere to be found ! Not in the recycle bin either !

I don't know what to do....

 
rid >> :

Don't know what to do....

Looking for a spy?

Try to use something like undelete at the same time.

 

That's not all.

Here's what I'm looking at!

All the other folders with turkeys, scripts, libraries - also empty'

 
TheXpert >> :

Looking for a spaa?

>> in the meantime, try and do some undelete.

I don't get it. What is spy and "something like undelete". ?

I'm sitting in great sadness.

 
rid >> :

I don't get it. What is spy and "something like undelete". ?

>> I'm sitting here in great sadness.

It's a program that allows you to recover files that have been erased...

Search for it... >> find the russian version

Reason: