[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 249
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Don't ask, check with a tester... :)
the expert draws one line.
if the code says "draw line 1 if it's not drawn; draw line 2 if it's not drawn" - they can't not be drawn:)
Can you tell me why all the percentages are 0 in the test report? I.e. relative drawdown, maximum drawdown, etc.?
For example, like this:
Call like this:
I hope you can turn minutes into hours ... :)I tried to write it the way you said, but it works... it still opens positions at the close of the previous one...((
maybe you don't understand what i mean, i want it to open a position no earlier than 1 hour after the previous one was closed ... and in your case, it excludes the possibility of re-opening, but as soon as it closes, it immediately opens the next one
guys help: I need a deal to be opened if a certain amount of time has passed after the previous one was closed....help
for (int i=0; i<OrdersTotal(); i++)
{ if(OrderSelect(i, SELECT_BY_POS)==true)
{
TC = TimeCurrent();
OM = OrderMagicNumber();
if (TC-OM>86400 && (OrderType()==OP_SELL)){
CLOSEORDER("Sell");
}
if (TC-OM>86400 && (OrderType()==OP_BUY)){
CLOSEORDER("Buy");
}
}
}
In OrderMagicNumber() when opening an order it writes: Magic = TimeCurrent();
for (int i=0; i<OrdersTotal(); i++)
{ if (OrderSelect(i, SELECT_BY_POS)==true)
{
TC = TimeCurrent();
OM = OrderMagicNumber();
if (TC-OM>86400 && (OrderType()==OP_SELL)){
CLOSEORDER("Sell");
}
if (TC-OM>86400 && (OrderType()==OP_BUY)){
CLOSEORDER("Buy");
}
}
}
In OrderMagicNumber(), when opening an order, it's written: Magic = TimeCurrent();
I forgot =) 86400 - this is the number of seconds after which the position is closed
Can you tell me why all the percentages are 0 in the test report? I.e. relative drawdown, maximum drawdown, etc.?
All figured out - the deposit was too big)
I tried to write it the way you said, it works... it still opens a position at the close of the previous one...(
Maybe you don't understand what I mean, it needs to open a trade not earlier than 1 hour after the previous one was closed...and in your case, it excludes the possibility of opening a repeat trade, but as soon as it is closed, the next one is opened immediately
And think about the function code? Find four differences :) :