Thread: Martingale EA
View Single Post
  #488 (permalink)  
Old 02-16-2008, 04:31 PM
wolfe's Avatar
wolfe wolfe is offline
Senior Member
 
Join Date: Jan 2006
Posts: 830
wolfe is on a distinguished road
Quote:
Originally Posted by ElectricSavant View Post
I mean that the "architecture" should remain open allowing the user to load the EA on any TF. If a user wants a larger frequencey of trades he could load it on the M15....if he wants less trades over a longer span...he could use the H1. If the TF is hardcoded into the EA then the user would not have any choices. If he wants more trades with lower TP's...he would have no choice, in the case of an EA that has the TF hardcoded.

We should attempt an EA that works in all TF's and gives the user a choice at which one.

There could be a input to lookback at a rolling 1, 2, or three candles to determine the high or low breaches...

ES
Yes ES, you already have this.

Let's look a some code-

PHP Code:
int    spread=MarketInfo(Symbol(),MODE_SPREAD);
Next_Buy=((High[1])+(spread*Point)+(2*Point)); 
This basically says this- The next buy is the high of the previous bar + the spread of the currency + 2 additional pips.(kayvan's idea)

High[1] will always return the value of the high price of the previous bar (no matter what TF you are attached to).

Now we know use this to enter a trade-
PHP Code:
if ((Ask >= Next_Buy) && (Last_Type==OP_SELL))
   {
      
All the order sending stuff here... 
Attach to whichever TF you want the EA to read the high or low of the bar previous the current one.

Last edited by wolfe; 02-16-2008 at 04:56 PM.
Reply With Quote