PDA

View Full Version : MQL to VTL migration



magicmao2014
05-11-2014, 02:13 PM
Hi Experts,
here the i is from OrdersTotal


OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if (OrderType()==OP_BUY && OrderMagicNumber()==OrderID){
...
int res = OrderClose(OrderTicket(),OrderLots(),Bid,3,White); // close
...
}



We have three functions need help:
1. OrderMagicNumber
2. OrderClose
3. Print
What are the VTL version for the above functions.
for the Print, is it possible log in jounal (do not want a popup window)


thank you in advance.

Hassan-HS
05-11-2014, 03:00 PM
Hello,

1. OrderMagicNumber

There is no magic number in VTL, but we have ID that identifying that the orders and positions and you can make a special buffer array or file to store orders IDs that related to you EA to mark it (work-around) .

Anyway we have developed a comment to mark the positions and it we be available in next patch.

2. OrderClose, check the following articles

CloseMarketOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3621)
DeleteLimitOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1738)
DeleteSlTpOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3635)






Note:


Positions (market orders): The orders that have been already opened.

Orders: The pending orders (limits orders.managed orders)
Limits Orders: the orders that have open price,SL,TP , so when it is hit the order will become a position
Managed Orders: the orders that related to exist position so its have SL,TP.

the picture that in the attachment describe the location of the positions and orders in the trade panel (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2199).

1=> Positions
2=>Orders

Methods related to positions (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3713):

NewMarketOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1984)
CloseMarketOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1985)
OpenPositionByTicket (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2033)
OpenPositionByIndex (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2031)


Methods related to orders (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/3728):

NewLimitOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1990)
NewSLTPOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2849)
UpdateLimitOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1992)
UpdateSLTPOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1993)
DeleteSLTPOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1994)
DeleteLimitOrder (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1996)
LimitRelation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2856)
SLTPRelation (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/2857)


3-Print

use this function (http://www.hybrid-solutions.com/support/index.php?/Knowledgebase/Article/View/1757)



no you cant print data in journal but i will manage to add this feature in next version

magicmao2014
05-13-2014, 12:05 PM
thank you for the information