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

Back to topics list To post a new topic, please log in or register
avatar
2
Drama4 2016.03.11 11:50
 

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.  

 

 

 

 

Attached files:
  fractal_test.mq4  (13.48 KB)
avatar
872
eevviill 2016.03.11 12:02 #
 
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;

avatar
12998
WHRoeder 2016.03.11 13:58 #
 
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.

avatar
2
Drama4 2016.03.14 17:51 #
 

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... :(



 

avatar
12998
WHRoeder 2016.03.15 02:18 #
 
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.
Back to topics list  

To add comments, please log in or register