Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    Nov 2015
    Posts
    125

    Default Limit order issue

    Hi,

    I am trying to convert the attached script from mq4 to vtl. I am converted it as per mq4 logic. But it takes more number of orders than given variable 'NumberOfTrades'. It takes more time to take pending request before that the for loop iteration increase and it takes same lot order again and because of that it not working according to expert logic. Please can you guide me the solution for this problem.

    I have attached mq4 as well as my converted vtl file. Please guide me the solution asap.

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Administrator Rawan-HS's Avatar
    Join Date
    Apr 2015
    Posts
    411

    Default

    Dear BGT

    Quote Originally Posted by BGT View Post
    Hi,

    I am trying to convert the attached script from mq4 to vtl. I am converted it as per mq4 logic. But it takes more number of orders than given variable 'NumberOfTrades'. It takes more time to take pending request before that the for loop iteration increase and it takes same lot order again and because of that it not working according to expert logic. Please can you guide me the solution for this problem.

    I have attached mq4 as well as my converted vtl file. Please guide me the solution asap.

    Thanks in advance.
    As a solution after taking the first limit order put your code that takes the other limit order inside the OnOrderTrade event when actionType equal 12 (TRADE_LIMIT_ORDER_NEW) and when the takes order number is less or equal the NumberOfTrades, so you don't need to the loop iteration at all .

  3. #3
    Senior Member
    Join Date
    Nov 2015
    Posts
    125

    Default loop issue

    Hi,

    Thanks for your reply. Sir i have made changes as per your suggestion. Now initially it takes proper orders i.e. NumberofTrades. But if user cancels the order manually it should tell the order again as per the user close the order i.e. either buy stop or sell stop as per the order closed. I want to keep number os orders same as numberofTrades. i have put the code on ontick. But its again gives same issue. I takes more orders. Please suggest the solution. I have attach the new script.

    Thanks in advance.
    Attached Files Attached Files

  4. #4
    Administrator Rawan-HS's Avatar
    Join Date
    Apr 2015
    Posts
    411

    Default

    Dear BGT

    Quote Originally Posted by BGT View Post
    Hi,

    Thanks for your reply. Sir i have made changes as per your suggestion. Now initially it takes proper orders i.e. NumberofTrades. But if user cancels the order manually it should tell the order again as per the user close the order i.e. either buy stop or sell stop as per the order closed. I want to keep number os orders same as numberofTrades. i have put the code on ontick. But its again gives same issue. I takes more orders. Please suggest the solution. I have attach the new script.

    Thanks in advance.

    As I told you before in previous post , you have to depend on the OnOrderTrade event to check the limit order result so when client cancel the order the actionType will be equal = 13 , so open the new limit order if the OrderTotal is less than the numberOfTrade and you have to remove the newLimitOrder method from onTick to solve your issue .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to open Limit Order from BOAPI
    By nhasan in forum VertexFX API/VTL Forum
    Replies: 7
    Last Post: 08-22-2016, 10:43 AM
  2. STOP/LIMIT orders
    By Finsys Technical in forum VertexFX API/VTL Forum
    Replies: 7
    Last Post: 06-25-2015, 11:16 AM
  3. How to send a pending Limit Order from client side VTL
    By Edakad in forum VertexFX API/VTL Forum
    Replies: 13
    Last Post: 03-01-2015, 11:14 AM
  4. Stop/Limit on LP Side
    By Finsys Technical in forum VertexFX API/VTL Forum
    Replies: 2
    Last Post: 11-16-2014, 08:46 AM
  5. Not getting Trade for Limit Orders
    By Kanzariya Ashok in forum VertexFX API/VTL Forum
    Replies: 21
    Last Post: 03-20-2014, 03:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •