Useful tips for participants in the Championships - page 3

 
I wonder if you use Kloz to cover both buying and selling? And what's wrong withMarketInfo(OrderSymbol(), MODE_BID/MODE_ASK)?
 
Rosh:
I wonder if you use Kloz to cover both buying and selling? And what's wrong with MarketInfo(OrderSymbol(), MODE_BID/MODE_ASK)?
By the way, yes. You should close by MarketInfo(), but in no case by iClose (charts may not be loaded or pumped!).

For example:
if(OrderType()==OP_BUY)
     OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(),MODE_BID), SlipPage, Violet);
else OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(),MODE_ASK), SlipPage, Violet);
Now we'll check everything ourselves.
 
Ok. Why do we need iClose with parameters at all if they do not work? If iClose would give knowingly wrong value, it would at least cause requotes or something else. If the chart has not yet been loaded, it must give at least an error value but the previous value, while the iClose function itself fails.
 
Rosh:
I wonder if you use Kloz to cover both buying and selling? And what's wrong with MarketInfo(OrderSymbol(), MODE_BID/MODE_ASK)?

No, of course not.
 
Renat:
Rosh:
I wonder if you cover both buying and selling by Kloz? And what's wrong with MarketInfo(OrderSymbol(), MODE_BID/MODE_ASK)?
By the way, yes. You should close by MarketInfo(), but in no case by iClose (charts may not be loaded or pumped!).

For example:
if(OrderType()==OP_BUY)
     OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(),MODE_BID), SlipPage, Violet);
else OrderClose(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(),MODE_ASK), SlipPage, Violet);
We'll double-check it ourselves.

Ok. Thanks
So how do you propose to check if the chart is loaded or not, especially from someone else's chart? And you want to analyze it?
If unknown_error then sleep or smoke?
 
OpenStorm:
Ok. Then why do we need iClose with parameters at all if they don't work. I suspect that they just take values from MarketInfo. I think there is no difference. If iClose deliberately gave wrong values, the programmer would at least have requotes or something else. This is an "unknown error". If the chart has not been loaded yet, it must give at least an error value of the previous one, but the closing function itself fails in this case.
iClose is for accessing chart data. There is no guarantee that someone else's chart is 100% real and correct. And we should never use the values of iClose as a price in an order (no matter how you justify the correctness of such an action).

Since yesterday something has happened with your charts - so you have got problems.

We will investigate why there is an unknown error. But you still have not given us a sufficient piece of your code which also includes error handling. This is practical programming, not theoretical talk - you always need source code.
 
OpenStorm:
if unknown_error then sleep or smoke?
As always - code in the studio. As much code that is practically used as possible. And nothing else.
 
well sorry for stepping on the bug in the terminal - we are not

on purpose
we are not justifying anything. We'd rather not say anything.
 
OpenStorm:
Well sorry for stepping on the bug in the terminal - we are not

on purpose
we are not justifying anything. We'd rather not say anything.

So, instead of a quadruple request for a piece of practical source, we got an insult. It is us who should be offended, isn't it?

If there is a mistake, we are the ones primarily interested in correcting it. And we want to find it.

Unfortunately, some people are used to playing one gate (only MetaQuotes must answer to the maximum) and do not want to remove the protective cover from their gate (to clearly describe the problem and show a sufficient and practical piece of code). But thanks to those who are not afraid and go all the way :)
 
No hard feelings. You are asking for our code to be published BEFORE the championship. Any parts of it will not be published before or during the championship, no matter how offended you are. If our code fails due to errors in your testing process, feel free to remove us from the competition.


I promised to publish the code after the end of the competition.
Reason: