Follow The Bouncing Pip - page 110

 

forex_for_lowlife: You are an Idiot

forex_for_lowlife:
Couple observations, dewds.

1st, I'd rather follow a fine set of bouncing titties anyday.

2nd, would somebody please stuff a rag in ElectricServant's big trap?

3rd. Ok so lets talk about this Igor character. Now we all know the guy is absolutly obsessive-compulsive & possessed and can't keep his hands off anybody's threads. Of course he can always do it better. Why you ask? Well, come on. The guy is a Russky. An ex-Soviet. Everyone knows those guys are course, rude and crude. That's what happens when you grow up in stark gray concrete housing projects and are fed nothing but potatos and vodka. He probably was force to watch while his Mom did the local Commissar in exchange for heat. Childhood summers spent at math camp? Who remembers Kruschev? Dr. Zhivago? James Bond flicks? So there ya go.

--------------------------------

forex_for_lowlife: Your comments on Igor are senseless and you reached out of proprtions.

By the way, what's wrong with ex-Soviets?

If you ever read the literature, then you could have known the greatness of Boris Pasternak's creational character, Dr. Zhivago.

First try to learn your manners, then think of your forex.

You are an IDIOT! .

Sincerely,

rswamy4449

 
burn0050:
Actually, that's not true. This function uses a constant % risk of your account. If you use 50 or 100 pip stop loss, the $ amount will be the same. That's why the lot size changes. For example:

A $25k account, using 1.5% risk, that means you are willing to lose $375. The function uses stop loss * pip value to determine how many lots will equal $375. So, a bigger stop loss will mean a smaller lot size. Conversely, a smaller stop will mean a larger lot size. Tight stops will mean that you may not be able to make a purchase, because your leverage would be too large.

If you use a 5 pip stop loss on the GPB/USD, at 2.0071. With a 1.5% risk on a $25k account would mean a lot size of 7.5 lots. The same stop loss with 3% risk would mean a lot size of 15 lots.

So, unless you are altering both the stop loss and the risk percentage, then you must view this function using a constant risk. I can build in more logic to review the leverage used on the account to determine if the purchase can be made, which would probably help in this case. But suffice it to say that using this function with a small stop loss and a large percent risk will probably get you a lot of rejected orders.

Thanks,

burn0050

I understand what you are saying when you take the stoploss into account and rick means how much you are willing to lose.

You must have posted different code. The function I copied from your earlier post does not use stoploss anywhere. If risk is 10 it returns 10% of the account equity. For a 10K account it returns 1 lot. If the stoploss is 50 then the loss trade would be a max of $500 if there is no slippage. This is 5% of the account. That means an actual risk of 5%. The risk input is more like percent of account to trade.

Robert

 
MrPip:
I understand what you are saying when you take the stoploss into account and rick means how much you are willing to lose.

You must have posted different code. The function I copied from your earlier post does not use stoploss anywhere. If risk is 10 it returns 10% of the account equity. For a 10K account it returns 1 lot. If the stoploss is 50 then the loss trade would be a max of $500 if there is no slippage. This is 5% of the account. That means an actual risk of 5%. The risk input is more like percent of account to trade.

Robert

Yup, thats how all my MM modules work on all my EAs. % of equity!

Maybe there is a SL % MM somewhere, but I never saw that!

What burns mean maybe is the classical manual risk calculation of trading. And then you use his way to calculate the max % of possible loss due to SL.

 

Code

MrPip:
I understand what you are saying when you take the stoploss into account and rick means how much you are willing to lose.

You must have posted different code. The function I copied from your earlier post does not use stoploss anywhere. If risk is 10 it returns 10% of the account equity. For a 10K account it returns 1 lot. If the stoploss is 50 then the loss trade would be a max of $500 if there is no slippage. This is 5% of the account. That means an actual risk of 5%. The risk input is more like percent of account to trade.

Robert

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:

https://www.mql5.com/en/forum/177573/page70

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

 

!!!!!!!!!!!!!!!!!!!!!!!!!

forex_for_lowlife:
Couple observations, dewds.

1st, I'd rather follow a fine set of bouncing titties anyday.

2nd, would somebody please stuff a rag in ElectricServant's big trap?

3rd. Ok so lets talk about this Igor character. Now we all know the guy is absolutly obsessive-compulsive & possessed and can't keep his hands off anybody's threads. Of course he can always do it better. Why you ask? Well, come on. The guy is a Russky. An ex-Soviet. Everyone knows those guys are course, rude and crude. That's what happens when you grow up in stark gray concrete housing projects and are fed nothing but potatos and vodka. He probably was force to watch while his Mom did the local Commissar in exchange for heat. Childhood summers spent at math camp? Who remembers Kruschev? Dr. Zhivago? James Bond flicks? So there ya go.
 
burn0050:
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:

https://www.mql5.com/en/forum/177573/page70

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

I'm an absolute zero in coding...but looks like you are right on this one.

It's just the first time I see this. And I like it...by the way...as it is a real calculation of equity risk!

 

...

You go to whoever sold you the trip you are on and ask for money back because you are on a really bad trip, "dewd"

forex_for_lowlife:
Couple observations, dewds.

1st, I'd rather follow a fine set of bouncing titties anyday.

2nd, would somebody please stuff a rag in ElectricServant's big trap?

3rd. Ok so lets talk about this Igor character. Now we all know the guy is absolutly obsessive-compulsive & possessed and can't keep his hands off anybody's threads. Of course he can always do it better. Why you ask? Well, come on. The guy is a Russky. An ex-Soviet. Everyone knows those guys are course, rude and crude. That's what happens when you grow up in stark gray concrete housing projects and are fed nothing but potatos and vodka. He probably was force to watch while his Mom did the local Commissar in exchange for heat. Childhood summers spent at math camp? Who remembers Kruschev? Dr. Zhivago? James Bond flicks? So there ya go.
 

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.

 
burn0050:
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:

https://www.mql5.com/en/forum/177573/page70

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

 

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

Reason: