
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
Should Myexpert.Time(10) return the time of the tenth bar on the chart? And how to write it correctly?
Thank you
In theory, yes, it should...
The Time method, according to the documentation, gets the value of Time element by the specified index. It is a method of CExpertBase class, which is a base class for CExpert and all auxiliary classes of trading strategies.
Dear sergeev tells you correctly... it's best to use Debugger to determine the role of Time() method in your EA's life...
Thank you, Yedelkin !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
And EnumToString(timeframe), cool function!!! AND I'M BARAN!!!!!!
The function seems to have a ,,side,,- request.symbol= Symbol(); Why Symbol()? This is where the symbol for which we set TP and SL should be transferred. So, can we just remove the string request.symbol= Symbol();, like it is stupid nada?
Please advise how to set a rollover order at the stop level of the open main order and then delete it if the main order is closed at TP ?
I set both orders in the code at once:
The main order opens and closes at TP, and the reversal order hangs. If the main order has closed at stop, there would not be any problem )). What is the best function to close?
Should I go through the pending orders and delete them that way?
Or is there an easier way?So the question comes down to how to delete a pending order that is not an SL or TP order when certain events occur (in particular, when a TP order triggers at an open position).
At present, such a pending order can only be deleted compulsorily by sending the relevant "Delete Pending Order" request. So we have to monitor on the terminal side the occurrence of certain events and send a request. But unlike your variant, there are only two fields to be specified in the request, one of which is request.order.
In the situation you mention, OCO orders ("One Cansels Other(s)") would be helpful: on the TP level, an order would be placed with a volume equal to the open position, on the SL level, an order with the volume needed to "reverse" the position would be placed. If one of these OCO orders triggered, the second one would be automatically removed on the server side. However, throughout the life of this forum, the developers of the platform have been adamant about not introducing any additional order types, including OCO orders.
However, for as long as this forum has existed, the platform developers have categorically not agreed to introduce any additional order types, including OCO orders.
Try typing the word 'OCO' in Latin and Cyrillic in a forum search and read it.
You do not need this type of order.