Forex



Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #101 (permalink)  
Old 09-20-2008, 02:57 AM
Member
 
Join Date: Feb 2006
Posts: 30
arui is on a distinguished road
Result from this week- IBFX mini account
Attached Files
File Type: htm Statement.htm (19.3 KB, 429 views)
__________________
check latest EA trading result
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #102 (permalink)  
Old 09-20-2008, 01:53 PM
MT4free.com's Avatar
Junior Member
 
Join Date: Aug 2008
Posts: 25
MT4free.com is on a distinguished road
Adr

Quote:
Originally Posted by arui View Post
Result from this week- IBFX mini account
Great system, I just think this week was not the best one to check the system.

will update next week.
__________________
VISIT US AT:
http://WWW.MT4free.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #103 (permalink)  
Old 09-20-2008, 09:25 PM
Senior Member
 
Join Date: Feb 2006
Posts: 587
Michel is on a distinguished road
What's the original problem ?

I didn't check the lastest DerkWehler's version which seems a little complex, but the original version and the Omelette's ones have both the same bug.
The original version has also a recovery bug which was fixed by Omelette, but the code to fix it has itself the same bug.
Also, as Omelette said, it's NOT reliable to backtest EAs which are calling the OrderHistory, because during the backtest the history called is the real history of the account and NOT the pseudo history generated by the backtest itself. MQ is aware of this incredible bug, but don't care about it.
Now the bug itself comes from the fact that even if the History tab of the terminal is sorted by descending CloseTime, there is no guarantee that scanning the history from the last item the first order found is the last closed one. It is always needed to check this.
the initial code is
PHP Code:
int GetLotSizeFactor()
{
   
int histotal OrdersHistoryTotal();
   if (
histotal 0)
   {
      for(
int cnt=histotal-1;cnt>=0;cnt--) // retrieve closed orders counting from the last.
      
{
         if(
OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY))
         {
            if(
OrderSymbol()==Symbol() && OrderMagicNumber() == EA_MAGIC_NUM)
            {
               if(
OrderProfit() < 0// latest order close was a loss
               
{
                  
LotSizeFactor LotSizeFactor 1;
                  return (
LotSizeFactor);
               }
               else 
// latest order closed was a win
               
{
                  
LotSizeFactor LotSizeFactor 1;
                  if (
LotSizeFactor <= 0)
                  {
                     
LotSizeFactor 1;
                  }
                  return (
LotSizeFactor);
               }
            }
         }
      }
   }
   return (
LotSizeFactor); // no trades recorded in history just return the starting number.

I would sujest to replace this sub by this one:
PHP Code:
int GetLotSizeFactor()
{
   
int histotal OrdersHistoryTotal();
   
datetime LastCloseTime;
   
bool LastIsLoss;
   if (
histotal == 0) return (LotSizeFactor); // no trades recorded in history just return the starting number.       
   
else
   {
      for(
int cnt=histotal-1;cnt>=0;cnt--) // retrieve the last closed order
      
{
         if(
OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY))
         {
            if(
OrderSymbol()==Symbol() && OrderMagicNumber() == EA_MAGIC_NUM)
            {
               if(
OrderCloseTime() > LastCloseTime)
               {
                  
LastCloseTime OrderCloseTime();
                  
LastIsLoss OrderProfit() < 0;
               }
            }
         }
      }     
      if(
LastCloseTime == 0) return (LotSizeFactor); // no trades recorded in history just return the starting number.               
      
if(LastIsLossLotSizeFactor += 1;// latest order close was a loss
      
else LotSizeFactor -= 1;// latest order closed was a win
      
if (LotSizeFactor <= 0LotSizeFactor 1;
      return (
LotSizeFactor);
   }

And it is still needed to correct the recovery code in the same manner.
The routine I would use is this one, it doesn't need to recover anything as the lot size is based on the last order directly, which I think is more reliable; it doesn't work with a size factor, but with a size unit :
PHP Code:
double GetLotSize()
{
   
datetime LastCloseTime;
   
double NewLots;
   for(
int cnt=OrdersHistoryTotal()-1;cnt>=0;cnt--) // retrieve the last closed order
   
{
      if(
OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY))
      {
         if(
OrderSymbol()==Symbol() && OrderMagicNumber() == EA_MAGIC_NUM)
         {
            if(
OrderCloseTime() > LastCloseTime)
            {
               
LastCloseTime OrderCloseTime();
               
NewLots OrderLots() - LotsUnit*(2*(OrderProfit() < 0));
            }
         }
      }
   }     
   if (
NewLots <= 0) return(LotsUnit);
   return (
NewLots);


Last edited by Michel; 09-20-2008 at 10:10 PM. Reason: correction: GetLotSize() returns a double, not an int
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #104 (permalink)  
Old 09-20-2008, 09:43 PM
Senior Member
 
Join Date: Jan 2006
Posts: 1,119
omelette is on a distinguished road
Duh, didn't consider that! Nice.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #105 (permalink)  
Old 09-21-2008, 10:01 PM
Senior Member
 
Join Date: Feb 2007
Posts: 176
lcfxtrader is on a distinguished road
Here's my monthly statement. I lost internet service around the end of the 1st week in September. The EA is still not placing the correct lot sizes so I will continue testing manually or until the EA is fixed. Good trading to all.
Attached Files
File Type: htm SDS.htm (81.2 KB, 280 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #106 (permalink)  
Old 09-24-2008, 01:12 PM
Junior Member
 
Join Date: Oct 2007
Posts: 4
wallstreet03 is on a distinguished road
...

Hi, what is the backtest last years on eur usd and usd jpy ?
thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #107 (permalink)  
Old 10-06-2008, 07:15 PM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 394
WNW is on a distinguished road
Very worthwhile mod suggestion

I've been running this strategy manually for several weeks due to the lot sizing problem, however, I've not yet tried Derk's version.
I trade 17 pairs, no PSAR or ADR, just the 200 EMA for the signal.

Using the mod below this has been extremely profitable.

If any pair is in a progression but have a new watermark account balance high I halt any and every progression and start over.

This has resulted in never having gone over a 3 unit lot size on any pair.

So what we want to tell the EA to do is, "If I have any pair that has been trading more than 1 unit and my balance reaches an all-time high, stop the propression and start over with 1 unit on every pair.'"

I've tried in vain to code this. If someone could make the mod this thing would be dynamite.

Thanks in advance.

Last edited by WNW; 10-06-2008 at 07:21 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #108 (permalink)  
Old 02-25-2009, 07:18 PM
Member
 
Join Date: Jul 2008
Posts: 89
mtuppers is on a distinguished road
Quote:
Originally Posted by WNW View Post
I've been running this strategy manually for several weeks due to the lot sizing problem, however, I've not yet tried Derk's version.
I trade 17 pairs, no PSAR or ADR, just the 200 EMA for the signal.

Using the mod below this has been extremely profitable.

If any pair is in a progression but have a new watermark account balance high I halt any and every progression and start over.

This has resulted in never having gone over a 3 unit lot size on any pair.

So what we want to tell the EA to do is, "If I have any pair that has been trading more than 1 unit and my balance reaches an all-time high, stop the propression and start over with 1 unit on every pair.'"

I've tried in vain to code this. If someone could make the mod this thing would be dynamite.

Thanks in advance.
may not be possible, since there is no way to keep track the balance.

anyway the idea is

check x time ago to see what is different, may be able to using array.

if the different is reach certain amount. then reset the unite.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #109 (permalink)  
Old 02-25-2009, 08:01 PM
WNW's Avatar
WNW WNW is offline
Senior Member
 
Join Date: Feb 2006
Location: Motown, USA
Posts: 394
WNW is on a distinguished road
Sure it's possible, "AccountBalance" is an MT language function.

It can be tracked with an array, I just don't know how to do it.

Something like "if the current account balance is higher than the maximum previous account balance that I've been tracking in this array then do this (fill in the blank..)".
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #110 (permalink)  
Old 02-25-2009, 08:41 PM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
agreeably not impossible

If you only need to track highest balance, then you don't need an array for that, but simply a variable. Or two: one for the balance and one for its timestamp. If you want this to survive restart, you may need to keep it on file as well. (Alternatively include an initial account history scan to recover it; though this is easily done wrong )

The other condition, of a pair having traded 1 unit (since when the most recent
highest balance was reached [?]) requires account history processing; not too difficult either. (Or, it could possibly be maintained as a state flag that gets raised as soon as the condition arises; less computation but requires more care to ensure it is maintained correctly )
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
daily system, PSAR EA, forex, Forex Daily system, daily, simple daily system, ADR calculator mq4, forex adr calculator, simple daily system ea, sds ea, ADR Calculator, "simple daily system", adr calculator mt4, daily ea forex, SDS_UMM, SDS_UMM_ver1.mq4, adr calculator forex


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
FXiGoR DYNAMIC Breakout system on Daily Average Range iGoR Suggestions for Trading Systems 276 11-14-2009 06:31 AM
Daily ASC Trend system returned +766 pips in Jan kiwifxguy Suggestions for Trading Systems 13 11-13-2009 09:43 AM
simple 5/8 crossover daily chart PeterM Suggestions for Trading Systems 12 06-13-2008 02:13 PM
Daily high-low break system EA lmx2000 Expert Advisors - Metatrader 4 2 12-06-2006 01:00 PM


All times are GMT. The time now is 03:43 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.