Forex
Google
New signals service!

Go Back   Forex Trading > Trading systems > Martingale/Average Cost and Hedging


Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
LinkBack (20) Thread Tools Display Modes
  #291 (permalink)  
Old 01-29-2008, 11:31 PM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 719
wolfe is on a distinguished road
Quote:
Originally Posted by ElectricSavant View Post
I am waiting for the directional input to be in v1.5, where I can specify Long or Short as the initial opening (Then use long only or short only in conjunction with this)...Then I am going to use some indicator to give me a bias and use close-all and autorestart to false...with a basket of four non correlated pairs.

I may or may not utilize increments...I have not decided yet...I will prolly' test with increments first...

ES
Already have external variables Start_Long_NOW and Start_Short_NOW coded into v1_5.

Explain your (Then use long only or short only in conjunction with this)...

Do you want this coded into the EA, or are you wanting to just select this when you attach the EA to a chart?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #292 (permalink)  
Old 01-29-2008, 11:31 PM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 385
WNW is on a distinguished road
See below...

Last edited by WNW; 01-29-2008 at 11:36 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #293 (permalink)  
Old 01-29-2008, 11:33 PM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 385
WNW is on a distinguished road
You're making this all too complicated. Any compensating mechanism will work just as much against you as for you.

1. DON'T USE ANY INCREMENTING (DAMMIT!) This is the main cause of the problem.
2. Widen your grid and make it reasonable according to volatility
This is a matter of experimentation
3. Use pairs with low spreads, 3 pips or less
4. Stick with trending pairs, not volatile pairs. Euro is better than GBPJPY
5. Make your TP smaller than the grid size minus the spread
6. Don't use a SL.

Quote:
Originally Posted by Neo View Post
One of the things I've noticed is that we get further and further away from the goal as more positions are opened as each adds another "spread" to the floating loss which makes the job of catching up progressively harder as price then needs to move much further in a given direction without a reversed entry to have any hope of closing the series.

Not sure how best to overcome this issue but it will blow up the account at some point if left unchecked. This is especially a problem with wide spread pairs like GJ.

I've tried using a very small lot increment and this does help but the account will still blow at some point.

Thinking caps on, guys!

Last edited by WNW; 01-29-2008 at 11:41 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #294 (permalink)  
Old 01-29-2008, 11:36 PM
ElectricSavant's Avatar
Senior Member
 
Join Date: Jun 2007
Posts: 3,010
ElectricSavant is on a distinguished road
I will just manually choose it in the smiley common input when I start it.

ES

Quote:
Originally Posted by wolfe View Post
Already have external variables Start_Long_NOW and Start_Short_NOW coded into v1_5.

Explain your (Then use long only or short only in conjunction with this)...

Do you want this coded into the EA, or are you wanting to just select this when you attach the EA to a chart?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #295 (permalink)  
Old 01-30-2008, 01:44 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 719
wolfe is on a distinguished road
Quote:
Originally Posted by ElectricSavant View Post
I will just manually choose it in the smiley common input when I start it.

ES
O.K. Got it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #296 (permalink)  
Old 01-30-2008, 02:50 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 719
wolfe is on a distinguished road
v1_5 now has MM.

Working on order close features, and some testing.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #297 (permalink)  
Old 01-30-2008, 04:00 AM
ajk's Avatar
ajk ajk is offline
Senior Member
 
Join Date: Dec 2005
Posts: 230
ajk is on a distinguished road
kind of neat ea. ... will need to test... Lot of options to think about.
would like to only open orders if in positive. ...Never liked martingale that added to a loser.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #298 (permalink)  
Old 01-30-2008, 04:10 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 719
wolfe is on a distinguished road
Quote:
Originally Posted by ajk View Post
kind of neat ea. ... will need to test... Lot of options to think about.
would like to only open orders if in positive. ...Never liked martingale that added to a loser.
Let us know how testing goes.

Any ideas are welcome to make this EA more viable.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #299 (permalink)  
Old 01-30-2008, 05:01 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 719
wolfe is on a distinguished road
v1_5

It's been 3 weeks since the beginning of this EA project. I have just finished the fifth version of the EA.

I tried to simplify the code a bit, however I'm sure that more can be done. I also keep adding additional options, which doesn't necessarily make the code simpler.

I have added a money management option, as well as a start long, or start short feature. The user now has 4 options to start the first trade with, as well as many other options for how you want the EA to operate. Don't ask me for the best set up, because I don't know it yet.

Anyone using v1_5 for the first time will need to review and understand the external variables, there have been some changes:
PHP Code:
extern double  Start_Lot_Size=0.1;//starting lot size for cycle
extern double  Lot_Size_Increment=0;//Additional orders will increase by this amount
extern bool    Money_Management=false;//if true mm is used, if false lot size will be start_lot_size
extern double  Risk_Percent=1;//percent risk of your AccountFreeMargin() for starting lot size
extern double  Min_Lots 0.1;//minimum lot size if using money management
extern double  Max_Lots 5.0;//maximum lot size if using money management  
extern bool    Auto_Restart=false;//set to true if you want EA to re-start after each cycle
extern bool    Double_Lotsize=false;//set to true if you want to just double every lotsize, Lot_Size_Increment ignored if true
extern int     Max_Trades=50;//maximum number of trades allowed
extern bool    Close_All_Max=false;//select true if you want ALL orders to close if Max_Trades is hit 
extern int     Next_Trade=10;//next trade pip increment, (will trade this many pips above OR below last order)
extern bool    Close_By_Percent=false;//If true it will close by percent, if false it will close by Profit or Loss in $$
extern double  TP_Percent=5;//will take profit if profit is greater than percent of account balance (close all orders)
extern double  SL_Percent=10;//will stop loss if profit is less than percent of account balance (close all orders)
extern double  Close_By_Profit=10;//close if >= to this $ amount
extern double  Close_By_StopLoss=300;//Amount of money to close all if lost
extern bool    Use_MA_Entry=false;//select true if you want moving average to decide starting direction
extern int     MA_Period=7;//moving average period for calculation
extern int     Timeframe=3;//timeframe used for MA calculation, 1=1m, 2=5m, 3=15m, 4=30m, 5=1h, 6=4h, 7=1d
extern bool    Use_Manual_Entry=false;//if selected true you must enter Manuel_Long & Manuel_Short price you want trade to execute
extern double  Manual_Long=0;//Price at which to start cycle long
extern double  Manual_Short=0;//Price at which to start cycle short
extern bool    Start_Long_NOW=false;//if true EA will start long immediately
extern bool    Start_Short_NOW=false;//if true EA will start short immediately
extern int     Slippage=5;//slippage for ordersend command
extern int     Number_Of_Tries=5;//Number of tries to send an OrderSend()command if not going through 
Many options to choose from! Thanks for all the ideas and input.

v1_5 uses the same include file as v1_4. Include file is posted again for those who need it.

Let me know if any bugs are found. As always, happy testing.

-wolfe
Attached Files
File Type: mq4 TFX v1_5.mq4 (31.3 KB, 92 views)
File Type: mqh TFX_Include_v1_4.mqh (2.5 KB, 69 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #300 (permalink)  
Old 01-30-2008, 05:54 AM
Senior Member
 
Join Date: Jun 2006
Posts: 114
Cijas is on a distinguished road
Unhappy I was only trading one pair.

Quote:
Originally Posted by wolfe View Post
Cijas,

Could you post the statement to look at? Also, post the trade journal. Were there any errors in the journal?

I'm not too concerned with when your Next_Trade was hit. Next_Trade will execute when current price is >= (greater than, or equal to) your last open + Next_Trade for buys, or <= your last open - Next_Trade for sells. There could be many situations that you won't see your Next_Trade execute exactly on your set parameter. The EA is coded so when your Next_Trade situation is met (could be > for buys, or < for sells) to fire an Ordersend() command. If the server context is busy, re-quoting in a fast moving market, or not responding, the EA will try up to 5 times to put your order through. When the order finally does go through, you may or may not be EXACTLY on your Next_Trade price. GBPJPY with it's high spread, and fast moving volitility, makes it a good candidate NOT to land it's Next_Trade exactly where desired.

A little more concerning to me is why ALL orders didn't close when your 1% TP was met. Out of curiosity, what does 1% work out to.

The EA closes orders by identifying them by their magic number, it doesn't just close ALL open orders because you may have EA attached to more than 1 chart. Each currency pair is assigned it's own magic number for this purpose. In v1_5 (currently working on) I will try to address this issue.

What happened to you is all the orders didn't close, only one did. Then the EA looked at the last order placed (0.2) and when the conditions were met is added to that (0.3). In the next version I will put in some more fail safe measures to try and fix this problem.
Hi wolfe,

I was only trading GBPJPY contrary to what you thought.

These are my log and a screenshot.
Attached Images
File Type: gif trade.gif (61.3 KB, 211 views)
Attached Files
File Type: txt log du 20080129.txt (56.5 KB, 14 views)

Last edited by Cijas; 01-30-2008 at 05:59 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
martingale, martingale ea, martingale EA, martingale ea download

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/martingale-average-cost-hedging/11734-martingale-ea.html
Posted By For Type Date
ea - learn to trade forex swicki - powered by eurekster This thread Refback 06-05-2008 06:34 PM
[intraday]martingale strategy dan variasinya - Page 6 - Forexindo Forum This thread Refback 04-04-2008 03:15 AM
TFX v1.5 Expert Adviser - The Money Guru Forum - Money Making Discussions This thread Refback 03-31-2008 05:36 PM
Download 10points3 Ea - Type Your Search Here This thread Refback 03-12-2008 01:38 AM
Expert Advisor | Forex MetaTrader Expert Advisors | Over 40 of the Best EA's for MT4 on Squidoo This thread Refback 03-08-2008 08:36 PM
Expert Advisor | Forex MetaTrader Expert Advisors | Over 40 of the Best EA's for MT4 on Squidoo This thread Refback 03-07-2008 07:27 AM
Expert Advisor | Forex MetaTrader Expert Advisors | Over 40 of the Best EA's for MT4 on Squidoo This thread Refback 03-07-2008 03:27 AM
Expert Advisor | Forex MetaTrader Expert Advisors | Over 40 of the Best EA's for MT4 on Squidoo This thread Refback 03-05-2008 01:56 AM
Bright Idea's :: View topic - TFX Public EA Thread (work in progress) This thread Refback 02-29-2008 01:05 PM
Martingale Baggio Method - Page 11 This thread Refback 02-27-2008 09:59 PM
Martingale Baggio Method - Page 11 This thread Refback 02-27-2008 05:07 PM
Martingale Baggio Method - Page 11 This thread Refback 02-27-2008 05:04 PM
Martingale Baggio Method - Page 10 This thread Refback 02-25-2008 06:50 PM
Martingale Baggio Method - Page 10 This thread Refback 02-25-2008 06:07 PM
Martingale Baggio Method - Page 10 This thread Refback 02-25-2008 06:05 PM
Bright Idea's :: View topic - TFX Public EA Thread (work in progress) This thread Refback 02-23-2008 07:38 PM
Bright Idea's :: View topic - TFX Public EA Thread (work in progress) This thread Refback 02-04-2008 06:15 AM
Bright Idea's :: View topic - TFX Public EA Thread (work in progress) This thread Refback 02-03-2008 05:01 AM
Bright Ideas™ » TFX (an amazing EA) This thread Refback 01-15-2008 06:26 PM
World of Forex Trading » Martingale EA This thread Pingback 01-11-2008 02:33 AM

Similar Threads
Thread Thread Starter Forum Replies Last Post
Martingale Trend EA criss73 Expert Advisors - Metatrader 4 8 11-20-2008 02:56 AM
Reversed martingale mrv Expert Advisors - Metatrader 4 6 07-26-2007 01:28 AM
Leverage for martingale frantacech Expert Advisors - Metatrader 4 0 05-22-2007 02:17 PM
Martingale EAs? icepeak Expert Advisors - Metatrader 4 5 01-18-2007 03:21 AM