EA didn't take every entry on BackTest.

 

Hello!

I'm just wondering if anyone had the same problem... I would like to know what is wrong: script or backtest :p


Well, i have written a simple bool for trading:

bool buy_pb =

                                velas[1].close >= velas[1].open &&

                                velas[2].open  > velas[2].close && 

                                velas[3].open  > velas[3].close && 

                                velas[4].open  > velas[4].close ;

bool sell_pb =         

                                velas[1].close <= velas[1].open &&

                                velas[2].open  < velas[2].close && 

                                velas[3].open  < velas[3].close && 

                                velas[4].open  < velas[4].close ;

But as you can see, it only works some times:

Any clues?

Ty!

Files:
Sem_t2tulo.png  71 kb
 
Daniel Carvalho:

Hello!

I'm just wondering if anyone had the same problem... I want to know what are broke: the script or backtest ;)

Well, i have written a simple bool for trading:

But as you can see, it only works some times:

https://drive.google.com/file/d/1GDlJdt9T2V5eiRkxNCUl8KvlmQkX-5fv/view?usp=sharing

Any clues?

Ty!

Here's the clue: Check the rest of your code.

 
Seng Joo Thio:

Here's the clue: Check the rest of your code.


Okay, but since it works partially, could you please tell me where to look?
 
Daniel Carvalho:

Okay, but since it works partially, could you please tell me where to look?

First thing to check is the array velas - is it filled correctly?

Then look for the part where your code opens new trade - check through all the conditions that lead to it.

 
Seng Joo Thio:

First thing to check is the array velas - is it filled correctly?

Then look for the part where your code opens new trade - check through all the conditions that lead to it.

What is "velas" ?
 
Alain Verleyen:
What is "velas" ?
I assume candles in Spanish.
Reason: