Hi all!
I am trying to implement this strategy for the FDax with Zorro
FDax Pre-Market System (I'm afraid it is only in german :()
Here's my script so far:
function run()
{
BarPeriod = 60;
set(TICKS|LOGFILE);
int TakeProfit1 = 15;
int TakeProfit2 = 20;
int TakeProfit3 = 25;
int StopLoss1 = 35;
int StopLoss2 = 30;
int StopLoss3 = 25;
if (hour() >= 8 && hour() < 9){
if (price() >= (priceOpen() + 15)){
TakeProfit = TakeProfit1;
Stop = StopLoss1;
enterShort();
}
if (price() <= (priceOpen() - 15)){
TakeProfit = TakeProfit1;
Stop = StopLoss1;
enterLong();
if (price() >= (priceOpen() + 20)){
TakeProfit = TakeProfit2;
Stop = StopLoss2;
enterShort();
}
if (price() <= (priceOpen() - 20)){
TakeProfit = TakeProfit2;
Stop = StopLoss2;
enterLong();
}
if (price() >= (priceOpen() + 25)){
TakeProfit = TakeProfit3;
Stop = StopLoss3;
enterShort();
}
if (price() <= (priceOpen() - 25)){
TakeProfit = TakeProfit3;
Stop = StopLoss3;
enterLong();
}
}
}
}
When I look in the Logfile I see that all trades are entered a the same Price, so something must be wrong with my "if (price() >= (priceOpen() + x))" conditions :\
I think it's just a small error, but nevertheless I can't find it.
Hopefully someone can help me and thanks in advance for any advice