Zitat:
Zitat von UweBln
Ich hatte oben beschrieben um welche Vorgänge es sich handelt.
Der EA rechnet also aus 0,01 x1,5 = 0,01(5)
die (5) kürzt der Broker natürlich weg.
Deswegen brauche ich eine Aufrundung auf 0,02 Lot.
|
TestScript, 6 Durchgänge, die Werte werden extra auf volle Länge angezeigt, damit man sieht was wo gekürzt wird:
Code:
//+------------------------------------------------------------------+
//| Script program start function |
//+------------------------------------------------------------------+
void OnStart()
{
double MinLot = 0.01; //SmallestLotSize
double StartLots = 0.01; //StartWithSmallest
double NewLots = StartLots; //InitialValue
double Multiplier = 1.5; //FixMultiplierForLots
int Interations = 6; //HowOftenToMultiply
for(int i=0; i<Interations; i++) //fromZeroToInterations
{
NewLots=NewLots*Multiplier; //Multiply
double Deminite=NewLots/MinLot; //DivideByMinLot
double Result=NormalizeDouble(Deminite,2); //NormalizeTo2Digits
Print(" i="+IntegerToString(i) //PrintResults
+" NewLots="+DoubleToStr(NewLots)
+" Deminite="+DoubleToStr(Deminite)
+" Result="+DoubleToStr(Result) );
}
}
//+------------------------------------------------------------------+
AVT