You should provide a condition prohibiting division by zero, that's all. Although I'm not a high-level programmer, I don't forget about such things, despite the fact that exel has only 7 possible conditional jumps.
ikatsko: Why does the Print(TimeToStr(Time[0],TIME_MINUTES)); command give a result like 12:00[sl]? The issue here is the bracketed prefix. And how can I get a result without brackets? (Thanks in advance.)
Greetings, I remember that somewhere we have collaborated and touched and you have fulfilled my request. Thank you.
Right, don't divide by zero))))
Why does the Print(TimeToStr(Time[0],TIME_MINUTES)); command give a result like 12:00[sl]? The issue here is the bracketed prefix. And how can I get a result without brackets? (Thanks in advance.)
Are you sure? This is usually added to the order comment when closing at stop. [tp] is added when closing at take.
I pasted your line into an empty EA template and ran it in the tester at M15 on open prices:
No your [sl]Yes, you are right. Indeed the command was put after SL. I see. Thank you.
Hi all!!! I have an EA opening orders against the movement, how to change or advise where to change???
void modify_orders( int type )
{
int i;
datetime time_last = 0, time_first = TimeCurrent();
double SPREAD = MarketInfo(Symbol(),MODE_SPREAD)*MarketInfo(Symbol(),MODE_POINT), op_pr_last, op_pr_first, level;
for( i = OrdersTotal() - 1; i >= 0; i-- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if( OrderMagicNumber() == ID && OrderType() == type )
{
if ( OrderOpenTime() > time_last )
{
op_pr_last = OrderOpenPrice();
time_last = OrderOpenTime();
}
if ( OrderOpenTime() < time_first )
{
op_pr_first = OrderOpenPrice();
time_first = OrderOpenTime();
}
}
}
if ( type == 0 )level = op_pr_last + MathAbs(op_pr_last-op_pr_first) * (SL/100);
if ( type == 1 )level = op_pr_last - MathAbs(op_pr_last-op_pr_first) * (SL/100);
for( i = OrdersTotal() - 1; i >= 0; i -- )
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if( OrderMagicNumber() == ID && OrderType() == type && NormalizeDouble(OrderTakeProfit(),Digits) != NormalizeDouble(level,Digits) )OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),level,0);
}
}
double last_trade( int t )
{
Hi all!!! My EA is opening orders against the movement, how can I change or advise where to change???
Is there a hotkey combination to bring up the Alert window when it is closed?
Tell me how to draw an arrow using the LABEL object, using the Wingdings font.
Called to draw a red skull on the current candle at Bid price, size 1 using Arrow:
This is the function to display the text. They are similar. Try to make one yourself to output the marker.
Called to draw a red skull on the current candle at Bid price, size 1 using Arrow:
This is the function to display the text. They are similar. Try to make one yourself to output the marker.
Thank you. But you need it for a LABEL object, pixel by pixel.