get open price in my code

If you need an Indicator or Signal developed or translated from other language, please post all Indicator development REQUESTS to this section here.

Moderator: admin

get open price in my code

Postby blue-7777 » Thu Mar 08, 2018 10:28 am

Hello,

Few years ago Apprentice did a so called Delayed Market Order strategy for me here.
I attach it here with some modifications done by me.
I can't get the limit and stop prices of executed market order:
I don't know where in code I have to put these, to get prices:
AFAIK based on LUA documentation those prices are stored in valuemap.RateLimit and valuemap.RateStop. But these two get me empty values:
tp_5dec = valuemap.RateLimit
sl_5dec = valuemap.RateStop

Please can u review my code attached: search lua file for ""MODIFICATION 8.3.2016" to find my code
Thanks
Attachments
II-Delayed Market Order Strategy.lua
(10.35 KiB) Downloaded 407 times
blue-7777
 
Posts: 7
Joined: Thu Mar 08, 2018 4:28 am

Re: get open price in my code

Postby Apprentice » Fri Mar 09, 2018 6:46 am

Your request is added to the development list under Id Number 4069
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: get open price in my code

Postby blue-7777 » Fri Mar 09, 2018 7:45 am

Apprentice wrote:Your request is added to the development list under Id Number 4069


Ok, thanks, I could do this on my own, just need small help what I am missing with my code logic:

In function:
function ExtAsyncOperationFinished(cookie, success, message)
There is a line which calls enter() function:
enter(BuySell);

Now, in function "enter(BuySell)" there is:
valuemap = core.valuemap();

and I put additional code to try to store limit and stop prices:
tp_5dec = valuemap.RateLimit
sl_5dec = valuemap.RateStop
tp_4dec = valuemap.Rate -- for test only

Why are values of all these variables emtpy?
I defined them as, e.g: local tp_5dec; and when writing those to file, it is empty. (my code for writing to file is ok, because some other stuff is saved to file, but values of variables are empty)

I am close to make it work, but I'm missing something here...
Thanks
blue-7777
 
Posts: 7
Joined: Thu Mar 08, 2018 4:28 am

Re: get open price in my code

Postby Apprentice » Sat Mar 10, 2018 8:13 pm

Line 277
valuemap = core.valuemap();
--creating of valuemap


Line 322
tp_5dec = valuemap.RateLimit
sl_5dec = valuemap.RateStop
tp_4dec = valuemap.Rate
--This will NOT get any value because values are not set.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: get open price in my code

Postby blue-7777 » Tue Mar 13, 2018 3:15 am

Apprentice wrote:Line 277
valuemap = core.valuemap();
--creating of valuemap
Line 322
tp_5dec = valuemap.RateLimit
sl_5dec = valuemap.RateStop
tp_4dec = valuemap.Rate
--This will NOT get any value because values are not set.


Thanks. I understand. So how can I get limit and stop prices once after market order is executed please? It should be simple and I could code myself just need some help (trying to learn lua) Thanks
blue-7777
 
Posts: 7
Joined: Thu Mar 08, 2018 4:28 am

Re: get open price in my code

Postby Apprentice » Tue Mar 13, 2018 5:54 am

Try this version (previous request).
II-Delayed Market Order Strategy.lua
(12.58 KiB) Downloaded 442 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot] and 10 guests