Correct calculation of the lot from the % of the deposit - page 2

 
Roger:

Of course, I got it wrong, the real one is 100*100*100/100/100000=0.1

ah, sorry, I was looking at gold... so no trading in gold using your formula now ?

But still, even the Kiwi probably will not buy such a lot, and if you take the Eurobucks, there's even a limit of about 0.05 (we're talking about real money) ...

 
Why are you twisting things around? If you don't like it, don't eat it, or rather if you don't know how to use it, don't bother. If you had put it in the formula properly, it would have worked, even on gold.
 
Roger:
Well, why twist it, if you don't like it, don't eat it, or rather, if you don't know how to use it, don't bother. If you put it in the formula properly, it would work, even on gold.

...pulling the shutter...

What do you mean you don't like it? What should I do if I put in the above parameters to open a market order?

 
keekkenen:

the bolt is being jerked...

What do you mean if you don't like it, don't eat it? What do you have to do to open a market order using the parameters I mentioned above?


What has that got to do with humour? You were the first one to come and start - the formula is wrong, and why do you need it at all? Even without understanding it, on a hunch, it won't be any worse if you shit on it first.

If the dollar comes second, the calculation formula is different.

Facts, by the way, are also twisted.

 
Roger:
If you don't like it, don't eat it, or to be more precise, if you don't know how to use it, don't bother. If you put it in the formula properly, everything would work out, even on gold.

Well, let's say we opened with such a (0.1) lot, a reasonable question arises and how many points are left before Uncle Kolya, how long can we hold out?

But there are other orders, they do not "sit idly" on other pairs as well, they go down and uncle Kolya - knock, knock, how should we deal with it when there is real money at stake?

 
So what kind of normal would open on 100% of the depo? The objective was - I want to open on 5% of my spare money, how much would that be in lots. No other thought was pursued.
 

keekkenen:

If we have 100 quid, 100 leverage and 100% risk, i.e. we open at full, what do we get?


keekkenen:

Well, let's say we opened with such a (0.1) lot, a reasonable question arises, and how many points are left to Uncle Kolya, how much will we be able to withstand?

But there are other orders, they do not "sit idly" on other pairs either, they go down and Uncle Kolya does a knock-knock, how should one deal with it when there is real money at stake?

Do you often open a position with the whole deposit, and even with a real account (and with gold)?

How do you see the results?

 
wenay:
This one is much better, there is no leverage calculation with another way of doing it. I like very much the calculation of the lot based on the % of the deposit at a given distance of pips. i.e. "to drain 20% of the deposit in 10 pips = you need ?lot" this function asks and calculates

I did not notice any changes in the calculations, tikvalue was = 1 and remains the same when you change the leverage, and you can also lose when you change the leverage.

You can check yourself with the script your function, first opening a demo account with leverage 1/200 and open another account with the size of 1/100 changes in lot size does not happen and tikvalue as was 1 and remains, in my opinion the easiest way is just to make the initial leverage in external variables and jump from it in the calculations has worked, when you change leverage in the machine to a smaller immediately the lot is calculated on the smaller leverage.

int start()
  {

   double  tic  = MarketInfo( Symbol(), MODE_TICKVALUE ); 

   Comment(
   "AccountLeverage  =  ",AccountLeverage() ,"\n",
   "LotSize =  ",DoubleToStr(LotSize(OP_BUY,20,300),2)," TickValue =  ",DoubleToStr(tic,2) );

   return(0);
  }
//+------------------------------------------------------------------+
double LotSize( int type, double LotRisk, int SL  )
{   //    int znakov_lot=0;
        double  lot_min         = MarketInfo( Symbol(), MODE_MINLOT  ); 
        double  lot_max         = MarketInfo( Symbol(), MODE_MAXLOT  ); 
        double  lot_step        = MarketInfo( Symbol(), MODE_LOTSTEP ); 
        double  lotcost         = MarketInfo( Symbol(), MODE_TICKVALUE );       
                
        double  lot             = 0.0;
        double  dollarsPerPip   = 0.0;
        
        lot = AccountBalance()*LotRisk/100.0;
        dollarsPerPip = lot/SL;
     //   if (lot_min<2) {znakov_lot=0;  if (lot_min<0.2) {znakov_lot=1;  if (lot_min<0.02) {znakov_lot=3;  if (lot_min<0.002) {znakov_lot=4; }}}}      
        lot = NormalizeDouble( dollarsPerPip/lotcost, 2 );      
        
        lot = NormalizeDouble( lot / lot_step, 0 ) * lot_step;
        
        if ( lot < lot_min ) lot = lot_min;
        if ( lot > lot_max ) lot = lot_max;
        
        if ( AccountFreeMarginCheck( Symbol(), type, lot ) < 10 || GetLastError() == 134 ) 
        { 
                Alert ( "Impossible to open position with lot = ", DoubleToStr( lot, 2 ), ". Not enough money." );
                return(-1);
        }

        return( lot );
}
 
What is NormalizeDlouble() for in lot calculation?
 
wenay:
This one is much better, there is no leverage calculation here. I really like the calculation of the lot on the % of the deposit for a given distance of pps. i.e. "to drain 20% of the deposit in 10 pps = you need ?lot" function this question and counts

lot = AccountBalance()*LotRisk/100.0;
but surely here it should be AccountBalance and not AccountFreeMargin, then maybe not an expert by one lot?
Reason: