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
  #411 (permalink)  
Old 02-12-2008, 02:28 PM
ElectricSavant's Avatar
Senior Member
 
Join Date: Jun 2007
Posts: 3,010
ElectricSavant is on a distinguished road
Well..kayvan...lets hope we get something to test...there is plenty of room in the opening post for several versions...

I will try them all, as long as wolfe is willing to try!

Your enthusiasm is refreshing...kayvan...I seem to need a young traders excitement lately to keep my interest in Forex and the search!

ES

Quote:
Originally Posted by kayvan View Post
no mater which pair it will sweep the market

Last edited by ElectricSavant; 02-12-2008 at 02:31 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #412 (permalink)  
Old 02-12-2008, 04:46 PM
kayvan's Avatar
Senior Member
 
Join Date: Mar 2007
Location: .....
Posts: 145
kayvan is on a distinguished road
Quote:
Originally Posted by ElectricSavant View Post
Well..kayvan...lets hope we get something to test...there is plenty of room in the opening post for several versions...

I will try them all, as long as wolfe is willing to try!

Your enthusiasm is refreshing...kayvan...I seem to need a young traders excitement lately to keep my interest in Forex and the search!

ES
don`t search .you won`t find anything , i did a lot , but i find nothing except loosing my money .new search ,new holly grail finding and new more loosing money.
i am not kayvan, i am his father ,and age near 60 . but why i have such a enthusiasm like a young trader . i think that`s because of my loosing (killing a lot of accounts that i don`t remember how many !!!! in about 6 years) in forex.that was all i find from searching .
but I belive there is away (the only way) that we can get money from forex
while we are always in trade .keep your hope, and let your enthusiasm also make refreshing the thread. have a good time .

Last edited by kayvan; 02-12-2008 at 04:48 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #413 (permalink)  
Old 02-13-2008, 01:14 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 719
wolfe is on a distinguished road
Quote:
Originally Posted by waltini View Post
Hi Wolfe,

in an attempt to keep drawdown to a minimum I have coded in a break Even and a trailing stop. I can use either or both. It works well enough but I did it late last night and am still mucking around with the best settings.

I am more than happy to post it but it is your thread and it is disruptive to post a heap of private versions.

So I can either send it to you privately or post it if you are interested.

Oh and I have also limited the maximum lot size as an external.

My next thoughts are to limit the amount of orders in a sideways market and only allow extra orders on a price breakout.
I like your ideas here, I have been experimenting with a TS myself. I don't mind if you want to post your version. I welcome all new ideas. If you don't wish to post, I would love to look at your code. I always learn something new from other coders. Check your PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #414 (permalink)  
Old 02-13-2008, 01:46 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 719
wolfe is on a distinguished road
Quote:
Originally Posted by kayvan View Post
i beg you to do this changes to your ea
Don't beg! Take it easy, I'll give it a try. Be patient.

Quote:
Originally Posted by kayvan View Post
believe me it will be a perfect ea with this changes please do it
You say you want these changes to the EA. These are not "simple" changes, more like a completely different EA. I have been getting many requests for coding lately, so again be patient. I'll get to it.

Quote:
Originally Posted by kayvan View Post
ur first order with initial entry (say .1 & buy) active d we do nothing at the next bar and second next bar & third next bar &&&&&..... till price return 2 pips below the previous bar .then we enter sell with double size ,and continue to this every time this break out happened.
To verify, we are always looking at the previous bar high and previous bar low from the current bar for the break out trigger? Also, are we DOUBLING each progression, or just adding 0.1 each time? 0.1, 0.2, 0.4... OR 0.1, 0.2, 0.3...? Are we simply exiting the trade with an external TP variable?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #415 (permalink)  
Old 02-13-2008, 02:19 AM
ajk's Avatar
ajk ajk is offline
Senior Member
 
Join Date: Dec 2005
Posts: 230
ajk is on a distinguished road
wolfe, did you ever get that ts programmed. Otherwise, it will be difficult to make this a profitable adventure.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #416 (permalink)  
Old 02-13-2008, 03:04 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
wolfe, did you ever get that ts programmed. Otherwise, it will be difficult to make this a profitable adventure.
Yes I did. I'm still testing it. Seems to be working.

It looks something like this-(this part keeps track of your highest profit in the cycle)
PHP Code:
Total_Profit=OPBM(Magic_Long)+OPBM(Magic_Short);

if (
Trailing_Stop==true)  
{
 
Open_Profit=Total_Profit;
 
Highest_Profit=GlobalVariableGet(TFX_Highest_Profit);
 if (
Open_Profit Highest_Profit)
  {
   
Highest_Profit=GlobalVariableSet(TFX_Highest_Profit,Total_Profit);
   
Highest_Profit=GlobalVariableGet(TFX_Highest_Profit);
   
Loss_Percent=TSLoss_Percent*0.01;
   Print(
"                                                                                                 Loss percent = ",Loss_Percent);
   
Allowed_Loss=GlobalVariableGet(TFX_Highest_Profit)*Loss_Percent;
   
Allowed_Loss=GlobalVariableSet(TFX_Allowed_Loss,Allowed_Loss);
   
Allowed_Loss=GlobalVariableGet(TFX_Allowed_Loss);
   Print(
"                                                                                      Highest Profit = ",Highest_Profit);
   Print(
"                                                                                        Allowed Loss = ",Allowed_Loss);
  }

And this part handles the closing of a cycle-
PHP Code:
if ((Trailing_Stop==true) && (Trail_Engaged==true)) 
{
 if (
OPBM(Magic_Long)+OPBM(Magic_Short) <= (GlobalVariableGet(TFX_Highest_Profit)-GlobalVariableGet(TFX_Allowed_Loss)))
  {
   while(
OTBM(Magic_Long)+OTBM(Magic_Short)>0)
   {
   
CBM(Magic_Long);CBM(Magic_Short);
   }
     if (
OTBM(Magic_Long)>0)
      {
       
Sleep(1000);CBM(Magic_Long);
      }
     if (
OTBM(Magic_Short)>0)
      {
       
Sleep(1000);CBM(Magic_Short);
      }
     if (
OTBM(Magic_Long)+OTBM(Magic_Short)==0)
      {
       
GlobalVariableSet(TFX_LastTicketL,0);
       
GlobalVariableSet(TFX_LastOpenL,0);
       
GlobalVariableSet(TFX_LastLotsL,0);
       
GlobalVariableSet(TFX_LastTicketS,0);
       
GlobalVariableSet(TFX_LastOpenS,0);
       
GlobalVariableSet(TFX_LastLotsS,0);
       
GlobalVariableSet(TFX_Highest_Profit,0);
       
GlobalVariableSet(TFX_Allowed_Loss,0);
      }
     
Highest_Profit=GlobalVariableGet(TFX_Highest_Profit);
     
Allowed_Loss=GlobalVariableGet(TFX_Allowed_Loss);
     
Trail_Engaged=false;
    }
  } 
I don't want to post until further testing is satisfied. Plus I have some more ideas for it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #417 (permalink)  
Old 02-13-2008, 03:17 AM
ajk's Avatar
ajk ajk is offline
Senior Member
 
Join Date: Dec 2005
Posts: 230
ajk is on a distinguished road
very nice coding! original. --- There is some merit in this type of thinking... I think The last order in the line is the loser so---- The processing logic hopefully will be effective. -- not an easy task to make work properly. To a certain extent, the ea tries to profit out of random... basically take your "run and get out" before the market decides to b slap ya around..

Last edited by ajk; 02-13-2008 at 03:35 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #418 (permalink)  
Old 02-13-2008, 03:31 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
very nice coding! original. --- There is some merit in this type of thinking... I think The last order in the line should be a fast one. -- right before the market turns. I always appreciate coders who can do the order processing logic effectively -- not an easy task to make work properly. To a certain extent, we are trying to profit out of random... basically take your "run and get out" before the market decides to b slap ya around..
Thanks for the compliments ajk. The TS does seem to work properly, just not sure if it is plugged into the right EA method!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #419 (permalink)  
Old 02-13-2008, 03:40 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 719
wolfe is on a distinguished road
Quote:
Originally Posted by kayvan View Post
no mater which pair it will sweep the market
All right kayvan, here is the first crack at your idea. Have a try, I'm still not sure if this is EXACTLY what you are looking for.

Have a look at a visual back test shot of your method-

Give it a try, I'm sure this is not finished yet. Very roughly changed to try and fit your idea.
Attached Images
File Type: gif tfx_kayvan.gif (27.0 KB, 219 views)
Attached Files
File Type: mq4 TFX_kayvan_v1.mq4 (31.3 KB, 88 views)
File Type: mqh TFX_Include_v1_4.mqh (2.5 KB, 43 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #420 (permalink)  
Old 02-13-2008, 02:54 PM
kayvan's Avatar
Senior Member
 
Join Date: Mar 2007
Location: .....
Posts: 145
kayvan is on a distinguished road
Quote:
Originally Posted by wolfe View Post
All right kayvan, here is the first crack at your idea. Have a try, I'm still not sure if this is EXACTLY what you are looking for.

Have a look at a visual back test shot of your method-

Give it a try, I'm sure this is not finished yet. Very roughly changed to try and fit your idea.

thanks a lot for all you have done , wolf . I made some forward test today ,there are some error in taking position . that i `ll try to show them in the charts attached below. i actived ea a little after crossing below cnndle 7 in my mt4 time .the first position was sell @1.9572 @8.35 in h1 ok . but as you see we have the second position opened buy @1.9597 . this is false .why? because the price did`t cross the previous candle (2 pips+spread ).as you see in the picture those 2 bars( 9 and it`s previous 8 ) have the same high point (1.9597).so this buy order must not opened at that point.
and also you can see we have a sell order opened @ 1.9567 while price did`t cross previous bar 2 pips below( in sell order no need to add spread)


.forward-test1.gif




in the second picture we have 1 buy order actived @ 1 .9583 while our previous bar high point is 1.9586 . it must be opened @ 1.9591(2pips plus spread).


forward-test2.gif





any way in third picture you can see the result. thanks again and waiting for corrections.



forward-test4.gif

Last edited by kayvan; 02-13-2008 at 02:56 PM.
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