2015.07.3015:49:21.1712015.06.3008:27 Neuer Versuch Long only EURUSD,M15: Open - Supertrend #-2147483645.879912015.07.3015:49:21.1712015.06.3008:27 Neuer Versuch Long only EURUSD,M15: Openprice #1.120092015.07.3015:49:21.1712015.06.3008:27 Neuer Versuch Long only EURUSD,M15: Supertrend #2147483647
Your iCustom call to the indicator is returning EMPTY_VALUE, I don't see how this can be used when calculating a stop loss
Is this using the same parameters for the iCustom call as in your EA?
Do you think that -2147483645.87991 can be used as a stop loss?
But now the ea sends 10000 Orders and the trailingstop doesn´t work either.
He has to send 1 Order per signal and just get with the trailingstop.
Here he places the Order...per 1 Signal:
if(rsio() == true && BBo() == true && sto() == true && OrdersTotal()== 0) //Wenn Alle Indikatoren true sind und die offenen Positionen in diesem Markt 0 sind, eröffne eine long - Position.
{
if (Bid > sl) ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,10,sl,0, "My Order",16384,0,Green); //Order soll erstellt werden. if(ticket == 0)
{
Print("OrderSend failed with error #",GetLastError());
}
elsePrint("OrderSend placed successfully #" + string(ticket));
And this is, where the trailing stop should work:
if (Time[0] != OldBar) {
if( OrderSelect(ticket,SELECT_BY_TICKET) && OrderCloseTime()==0 ) //Trailingstop, der auf Basis des SuperTrend Indikators nachgezogen werden soll. (Nur für Long)
{
if( OrderType()==OP_BUY )
{
bool ordermodify = OrderModify(OrderTicket(),OrderOpenPrice(),sl,0,0);
if (ordermodify == false)
{Alert ("Stoploss NICHT nachgezogen! ERROR!");}
else
{Alert ("StopLoss nachgezogen");}
}
}
OldBar = Time[0];
}
I don´t know, where i failed.....i searched the whole code.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Your iCustom call to the indicator is returning EMPTY_VALUE, I don't see how this can be used when calculating a stop loss
Is this using the same parameters for the iCustom call as in your EA?
Do you think that -2147483645.87991 can be used as a stop loss?
Your iCustom call to the indicator is returning EMPTY_VALUE, I don't see how this can be used when calculating a stop loss
Is this using the same parameters for the iCustom call as in your EA?
Do you think that -2147483645.87991 can be used as a stop loss?
Ok...in a second thought you may be right ...
But why is it working as an initial Stoploss? (You can see that in the picture)
And yeah...it is the same parameter as in my ea. Does this matter? Because i thought the value would be the same so i could use it as a stoploss too.
Worldrecord for largest stoploss...can i get that award please :D
Thanks for helping me out man!
Best regards
But why is it working as an initial Stoploss? (You can see that in the picture)
You are using the indicator value as SL initially
But why is it working as an initial Stoploss? (You can see that in the picture)
You are using the indicator value as SL initially
Exactly. Then why it´s not working as a `trailingstoploss?
You are not using the indicator value as a trailing SL
You are using Open minus the indicator value
Actually i changed that.
But now the ea sends 10000 Orders and the trailingstop doesn´t work either.
He has to send 1 Order per signal and just get with the trailingstop.
Here he places the Order...per 1 Signal:
And this is, where the trailing stop should work:
I don´t know, where i failed.....i searched the whole code.
thanks for helping me out.
Best regards.
I don't see any calculations for sl.
Why don't you print the error?
A common error by some new coders is to check for a new bar more than once
The 2nd time, Oldbar has already been given the value of Time[0] so the 2nd block is not executed