Download MetaTrader 5

Fractal breakout EA. Need help with each fractal to be used only once?

To add comments, please log in or register
Drama4
9
Drama4  

Hello.

Please help, i think this is really simple but i don´t know how to do it. 

I need help modifying an EA that i have coded and adapted.
I want to modify it such that, once a fractal is used as a signal to open a trade, another trade will not be opened based on the same fractal.
This is to prevent the instance when, a trade is profitably closed and theprice comes back towards the fractal to head in the opposite direction.

This is the code that i have made so far. (i already had try a lot of options, a loop for for timing, TimeCurrent(), Time[variable] in loops, etc...but i am not expert in coding) 

And other issue is i want to make this EA to trade in same account but just one Pair. So i can have all the graphics that i want but the EA will trade in each individual Pair. For instance, it will read in OrderTotalHistory(), find last EURUSD positive/negative trade, and send new order.  

Files:
Vasyl Nosal
18650
Vasyl Nosal  
Drama4:

Hello.

Please help, i think this is really simple but i don´t know how to do it. 

I need help modifying an EA that i have coded and adapted.
I want to modify it such that, once a fractal is used as a signal to open a trade, another trade will not be opened based on the same fractal.
This is to prevent the instance when, a trade is profitably closed and theprice comes back towards the fractal to head in the opposite direction.

This is the code that i have made so far. (i already had try a lot of options, a loop for for timing, TimeCurrent(), Time[variable] in loops, etc...but i am not expert in coding) 

And other issue is i want to make this EA to trade in same account but just one Pair. So i can have all the graphics that i want but the EA will trade in each individual Pair. For instance, it will read in OrderTotalHistory(), find last EURUSD positive/negative trade, and send new order.  

 

 

 

 

Just set new variable where will be time of bar where was fractal.

And than when you create for()

add if(Time[i]<=last_frac_time)  break;

whroeder1
14778
whroeder1  
Since a fractal can only form when the third bar completes, only test on a new bar.
static datetime time0=0;
datetime prev = time0; time0 = Time[0];
bool isNewBar = time0 != prev;
if(isNewBar){
   double frac = iFractals(NULL,0, MODE_UPPER, 3);
   if(fract != 0) // found one.
Drama4
9
Drama4  

Hello! 

 

So eeviill and WHRoeder, i have tray to modified the code according your ideas, but i didn´t make any progress, for intenses, WHReoder, how i input that code in the EA?? I think my problem is about coding... :(



 

whroeder1
14778
whroeder1  
I gave you the code. There is no "how i input that code" learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
To add comments, please log in or register