Forex



Go Back   Forex Trading > Discussion Areas > Suggestions for Trading Systems
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

View Poll Results: What Do You Think?
Good 707 87.39%
Bad 102 12.61%
Voters: 809. You may not vote on this poll

Reply
 
Thread Tools Display Modes
  #1101 (permalink)  
Old 09-17-2007, 09:38 AM
Administrator
 
Join Date: Sep 2005
Posts: 20,054
Blog Entries: 241
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Hi forex_for_lowlife,

Don't watch American movies too much

By the way, forex_for_lowlife is having the same IP with our famous spammer so no need to reply to him.

Last edited by newdigital; 09-17-2007 at 09:49 AM.
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
  #1102 (permalink)  
Old 09-17-2007, 10:11 AM
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 560
MrPip is on a distinguished road
Quote:
Originally Posted by burn0050 View Post
Are you sure you are not talking about the code from nix (the autolot function)?

I posted the code into post 1046, which you quoted in post 1048:
http://www.forex-tsd.com/150350-post1048.html

This line:
double lotMM = ( AccountFreeMargin() * (accountRisk/100) )/( MarketInfo(Symbol(),MODE_TICKVALUE) * stopInPips );

As you see, "stopInPips" is used in the equation. This function: MarketInfo(Symbol(),MODE_TICKVALUE) returns the value of 1 pip when you have 1 lot.

Since you were a mathematical analyst, let's do some math:

For USD/JPY:
$25k free margin, with a 1.5% risk, 50 pip stop loss:
(25,000 * .015)/(8.68 * 50) = 375/434 = .86 lots

.86 lots * 8.68 = 7.47 pip value (1 pip = $7.47)
50 pips * $7.47 = $373.50 (due to rounding, not quite $375)

So, let's see what happens with a 100 pip stop loss:
(25,000 * .015)/(8.68 * 100) = 375/868 = .43 lots
.43 lots * 8.68 = 3.73 pip value (1 pip = $3.73)
100 pips * $3.73 = $373 (again, due to rounding, not quite $375)

No matter what stoploss you put in, the dollar amount risked remains constant for this size account using this risk percent. As your account size changes, so will the dollar amount risked, but the percent risked remains the same. The stoploss does not affect the percent risked, only how much currency you buy.

If you see fault with my calculations, please tell me.

Thanks,
burn0050
You are right, I used nix AutoLots function.

I now have one more change to MM. I will now add your code as well and have a switch to chose which to test.

Robert
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
  #1103 (permalink)  
Old 09-17-2007, 11:01 AM
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 560
MrPip is on a distinguished road
Problem in MM function

burn0050,

There is a problem with your LotSize function that I have seen before.
It will not work with IBFX or those brokers no longer using lots. IBFX uses 1 for a minilots in a mini account while FXDD uses .1 for a minilot in a mini account. FXDD does not allow partial lots in a standard account while I believe IBFX does.

Some brokers are now using actual dollar amounts like $10000 instead of lots..

This causes problems writing MM functions in EAs.

For now I will simply post the code as is. I will work on figuring how to use your method with IBFX and update the EA for repost.

All results posted were using Nix version of AutoLots.

Robert
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
  #1104 (permalink)  
Old 09-17-2007, 11:52 AM
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 560
MrPip is on a distinguished road
Ea

I know many of you are waiting for this so I am posting it now.

The next phase of development will be finding a good exit method. The current method exits on the opposite signal from the two zigzag indicators.

For MM the input for Risk should be small for Burns method and can be larger for Nix version.

I hope the other inputs are obvious. The various strings are menus to chose what you want to test.

The best results tested on GBPJPY were using the default settings.

Using 3% Risk and Burns MM method did return $8695 on $10K account with drawdown of 15%. Largest profit was 2262, largest loss 438.
Average profit was 1328, average loss was 250.

Using 4% risk and nix MM method returned $8798 with drawdown of 7.8%. Largest profit was 2602, largest loss was 512.
Average profit was 1225, average loss was 171.

Let the testing begin.

Robert
Attached Files
File Type: mq4 bouncingPipEA_mpowerV3.mq4 (27.3 KB, 436 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
  #1105 (permalink)  
Old 09-17-2007, 11:57 AM
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 560
MrPip is on a distinguished road
Modificaions to EA

I am open to suggestions for removing code from the EA. If things like HA, HAS, CCI or Stochastics filters should be removed let me know. We should also work toward a single MM function.

Some of the filter indicators will be tested for exit as well. I am ecen thinking of using confirmation of arrow similar to entry rule.

That might allow some trades to reach greater profit, especially those trades that have many exit arrows after the first exit signal.

Suggestions for other exit methods are also welcome.
I will be coding a few myself.

Robert
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
  #1106 (permalink)  
Old 09-17-2007, 12:28 PM
basza's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 161
basza is on a distinguished road
Quote:
Originally Posted by MrPip View Post
I am open to suggestions for removing code from the EA. If things like HA, HAS, CCI or Stochastics filters should be removed let me know. We should also work toward a single MM function.

Some of the filter indicators will be tested for exit as well. I am ecen thinking of using confirmation of arrow similar to entry rule.

That might allow some trades to reach greater profit, especially those trades that have many exit arrows after the first exit signal.

Suggestions for other exit methods are also welcome.
I will be coding a few myself.

Robert
Hello MrPip

I have this mm in some of my ea's. I don't know if it would help you or not but I will post it just in case:
This bit goes at the top so that the user can choose which type they want
Code:
//////
/* Here is the MM settings...look at notes...if set to 0 then ea will trade with a fixed lot size..the size specified 
   in the above "extern double Lots = 1.0;" line. Might want to change this to 0.1.
   If 1 then it will trade a fixed percentage of the account balance
   If 2 then it will use a fractional portion (not to sure on this one..must look at code again)
   If 3 then a fractional fixed size meaning 1 lot for every 500 in account or so...the 500 is set below
     in the LotsDepoForOne - i.e. How many lots for each deposit amount of = 
     
     You must play around with it..cannot remember exact settings but I likes the setting to trade 1 lot for each $xx in account.
     Easy to maintain a say 500:1 ratio with it.
  */   

extern int LotsWayChoice  = 3;    // Lot size selection: 
                                  //  0-fixed lot size, 
                                  //  1-% from deposit, 
                                  //  2-fractional proportional, 
                                  //  3-fractional fixed lot size, 
extern int LotsPercent=0;   // % from deposit 
extern int LotsDeltaDepo=500;  // factor of deposit increase 
extern int LotsDepoForOne=500;  // deposit size for 1 mini lot 
extern int LotsMax=100; // Max number of mini lots 


double ldLot;
then some of the ea code till you get to the buy and sell part and enter in the following
Code:
ldLot = GetSizeLot();
         ticket = OrderSend(Symbol(),OP_SELL,ldLot,Bid,slippage,realSL,realTP,nameEA+" - Magic: "+magicEA+" ",magicEA,0,Red); // Sell
and then the final part at the bottom of ea code

Code:
///////////////////////////////////////////////////////////////////////////////////////
// This part is the function where the lot size is calculated

double GetSizeLot() {  
  double dLot; 
  if (LotsWayChoice==0) dLot=Lots; 

  // fixed % from deposit 
  if (LotsWayChoice==1) { 
    dLot=MathCeil(AccountFreeMargin()/10000*LotsPercent)/10; 
  } 

  // fractional proportional 
  if (LotsWayChoice==2) { 
    int k=LotsDepoForOne; 
    for (double i=2; i<=LotsMax; i++) { 
      k=k+i*LotsDeltaDepo; 
      if (k>AccountFreeMargin()) { 
        dLot=(i-1)/10; break; 
      } 
    } 
  } 

  // fractional fixed 
  if (LotsWayChoice==3) { 
    dLot=MathCeil((AccountFreeMargin()-LotsDepoForOne)/LotsDeltaDepo)/10; 
  } 

  if (dLot<0.1)  dLot=0.1;
  if (dLot>LotsMax) dLot=LotsMax;
   
  return(dLot);  
  }
I hope this is of some use to anyone.
__________________
http://www.kiwimate.info - Disposable Temporary E-Mail Address - E-Mail Marketer Other Services Soon
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
  #1107 (permalink)  
Old 09-17-2007, 12:47 PM
static's Avatar
Senior Member
 
Join Date: Apr 2006
Location: 西海岸
Posts: 125
static is on a distinguished road
Quote:
Originally Posted by MrPip View Post
I know many of you are waiting for this so I am posting it now.

The next phase of development will be finding a good exit method. The current method exits on the opposite signal from the two zigzag indicators.

For MM the input for Risk should be small for Burns method and can be larger for Nix version.

I hope the other inputs are obvious. The various strings are menus to chose what you want to test.

The best results tested on GBPJPY were using the default settings.

Using 3% Risk and Burns MM method did return $8695 on $10K account with drawdown of 15%. Largest profit was 2262, largest loss 438.
Average profit was 1328, average loss was 250.

Using 4% risk and nix MM method returned $8798 with drawdown of 7.8%. Largest profit was 2602, largest loss was 512.
Average profit was 1225, average loss was 171.

Let the testing begin.

Robert
Thanks for posting this, hopefully I can give it a try this afternoon.
__________________
魑魅魍魎
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
  #1108 (permalink)  
Old 09-17-2007, 01:56 PM
nix nix is offline
Senior Member
 
Join Date: Aug 2006
Posts: 132
nix is on a distinguished road
Quote:
Originally Posted by MrPip View Post
burn0050,

There is a problem with your LotSize function that I have seen before.
It will not work with IBFX or those brokers no longer using lots. IBFX uses 1 for a minilots in a mini account while FXDD uses .1 for a minilot in a mini account. FXDD does not allow partial lots in a standard account while I believe IBFX does.

Some brokers are now using actual dollar amounts like $10000 instead of lots..

This causes problems writing MM functions in EAs.

For now I will simply post the code as is. I will work on figuring how to use your method with IBFX and update the EA for repost.

All results posted were using Nix version of AutoLots.

Robert
This modification of my previous AutoLot function should do the trick and takes the StopLoss value into consideration:

Code:
double AutoLots(int Risk, int StopLossInPips, double MIN_lots = 0.1, double MAX_lots = 5)
{
   int    Decimals = 0;
 
   double LotStep = MarketInfo(Symbol(), MODE_LOTSTEP);
   double LotSize = MarketInfo(Symbol(), MODE_LOTSIZE);
   double LotTickValue = MarketInfo(Symbol(), MODE_TICKVALUE);

   if(LotStep == 0.01)
      Decimals = 2;
   if(LotStep == 0.1)
      Decimals = 1;

   double LotsToRisk = ((AccountFreeMargin()*Risk)/100)/StopLossInPips;
   double Lots = StrToDouble(DoubleToStr(LotsToRisk/LotTickValue,Decimals));
  
   if (Lots < MIN_lots)
      Lots = MIN_lots;
   if (Lots > MAX_lots)
      Lots = MAX_lots;

   return(Lots);    
}
__________________
NiX @ www.mt4.pl

Last edited by nix; 09-17-2007 at 05:57 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
  #1109 (permalink)  
Old 09-17-2007, 03:21 PM
ElectricSavant's Avatar
Senior Member
 
Join Date: Jun 2007
Posts: 3,354
ElectricSavant is on a distinguished road
Thanks Mr. Pip...

Hey! I bet Don is happy...it is more convienient for him to download from here and resell it...This could be like the central meeting place!

ES
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
  #1110 (permalink)  
Old 09-17-2007, 03:49 PM
Member
 
Join Date: Jun 2006
Posts: 42
hoss is on a distinguished road
Nice little short on the Euro this morning.
Attached Images
File Type: gif eurusd.gif (8.3 KB, 1175 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
Reply

Bookmarks

Tags
forex tsd, forex-tsd, bouncing pips, Bouncing Pip, follow the bouncing pip, Supernova, bouncing, nonlag zigzag, nonlagdot, bouncing pip ea, forex, BigBear, MrPip, signal_bars_v6, MACD-DIV, QQE_Alert_MTF_v5, signal_bars_v6.ex4, bear system forex tsd, Jacko, tsd forex, follow, mr pip, zig zagy, big bear, the bouncing pip, f4mnect, qqe repaint, orderclose error 4108, mode_tickvalue, follow the bouncing pips, boucing pips, candles, qqe alert, boucing pip, mtf mfi, forex suggestions, #00_ZZ_Window, NonLagZigZag_V2, bouncingpip, forex bouncing pip, Money Flow Index, fastbrokerfx, zig zag pointer, macd div


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


All times are GMT. The time now is 05:58 AM.



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