Zitat:
Zitat von traderdoc
Auf die Schnelle mal eine Hilfslösung:
Code:
double TP_Prozent = 10.0;
double TakeProfit = NormalizeDouble(OrderOpenPrice()*(1+(TP_Prozent/100.0)),2);
int TP = TakeProfit;
double Nachkomma = TakeProfit - TP;
if (Nachkomma <= 0.12) TakeProfit = TP;
if (Nachkomma > 0.12 && Nachkomma <= 0.37) TakeProfit = TP + 0.25;
if (Nachkomma > 0.37 && Nachkomma <= 0.62) TakeProfit = TP + 0.5;
if (Nachkomma > 0.62 && Nachkomma <= 0.87) TakeProfit = TP + 0.75;
if (Nachkomma > 0.87) TakeProfit = TP + 1.0;
traderdoc
|
Code:
double TP_Prozent=10.0;
double TakeProfit=NormalizeDouble(10744.25*(1+(TP_Prozent/100.0)),2);
double TP=TakeProfit;
double Nachkomma=TakeProfit-TP;
Nachkomma =0;
weil TP=TakeProfit; TakeProfit-TP=0
wenn int TP , kommt warning
int TP=(int)TakeProfit; richtig