RE: Editing/Deleting Entry and Stop Orders

Moderator: admin

RE: Editing/Deleting Entry and Stop Orders

Postby Karlo_Karlo » Fri Jan 07, 2011 5:57 am

I am trying to make my strategy to work. I have almost done it but as far as I am not a programmer I am facing certain difficulties, especially with changing/deleting fixed Entry and Stop Orders (without trailing). The problem comes when I am trying to find the OrderID for the certain Entry or Stop orders.

I would ask to help me and give me an idea how to create this function which will first find the Orders and then bring them to new position or delete them.

Karlo
Karlo_Karlo
Karlo_Karlo
 
Posts: 11
Joined: Fri Jan 07, 2011 4:48 am

Re: RE: Editing/Deleting Entry and Stop Orders

Postby Timon55 » Fri Jan 07, 2011 9:51 am

It's pretty simple. In http://www.fxcodebase.com/documents/Ind ... ecute.html we can find following note:
"If the request has been successfully sent, the AsyncOperationFinished function of the strategy will be called with the following three parameters:
..............................
info
A string, which contains:

* [in case successful is true] The order identifier for the the "create order commands or an empty string in all other cases.
* [in case successful is false] The error text received from the server.
"


Example for this case:

Code: Select all
-- variables
local createOrderCookie = 103; -- cookie for create order command
local aOrderID; 

-- function for creating order
function CreateOrder()
     valuemap = core.valuemap();
      ................................
      terminal:execute(createOrderCookie, valuemap);
end

function AsyncOperationFinished(cookie, success, message)
    if cookie == createOrderCookie and success then
        aOrderID = message;
    end
end
Timon55
FXCodeBase: Confirmed User
 
Posts: 43
Joined: Thu Jul 15, 2010 5:35 am
Location: Omsk


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 48 guests