Requesting Real Volume data downloader

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

Requesting Real Volume data downloader

Postby Abschoning » Sat Feb 15, 2020 1:18 pm

Hi,
I am interested in having a lua script developed that can provide me with the data presented in FXCMs Real Volume indicator.

I am proficient in python but find it dificult to figure out .lua :?

So far I have managed to add some code to a existing lua script I found on here: http://fxcodebase.com/code/viewtopic.php?f=28&t=61403&p=121729&hilit=csv#p121729

However the code correctly loads the real volume indicator but only zeroes are printed to the csv file :(

I suspect that it is quite easy to fix, and it is probably because the indicator is not updated correctly.

The pseudo code is something like:
-- Load indicator
Ind=core.indicators:create("REAL VOLUME", source);

-- Create line to be printed to csv file.
Str = Counter .. ";" .. Time.day .. "/" .. Time.month .. "/" .. Time.year .. " " .. Time.hour .. ":" .. Time.min .. ":" .. Time.sec;

Str = Str .. ";" .. source.open[period] .. ";" .. source.high[period] .. ";" .. source.low[period] .. ";" .. source.close[period] .. ";" .. Ind.DATA[period] ..'\n';

-- print to designated .csv file and repeat when a new period starts.
FileRec:write(Str);

Hope you can help
Abschoning
 
Posts: 3
Joined: Sat Feb 15, 2020 12:11 pm

Re: Requesting Real Volume data downloader

Postby Apprentice » Sun Feb 16, 2020 6:11 am

Your request is added to the development list.
Development reference 732.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36437
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Requesting Real Volume data downloader

Postby Apprentice » Mon Feb 17, 2020 7:21 am

Real volume indicator loads data from the server.
It'll show 0 until that point.
There is no way in fixing that.
Just check for 0 and dump data into CSV file when it start to show non 0 data.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36437
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Requesting Real Volume data downloader

Postby Abschoning » Tue Feb 18, 2020 7:23 am

Apprentice wrote:Just check for 0 and dump data into CSV file when it start to show non 0 data.


So I could write the following code for example:

while Ind.DATA[period] = 0 do
pass
end
Abschoning
 
Posts: 3
Joined: Sat Feb 15, 2020 12:11 pm

Re: Requesting Real Volume data downloader

Postby Apprentice » Wed Feb 19, 2020 2:36 pm

While indicator code is executing the whole FXTS2 freezes, including the downloading data.
While loop blocks downloading of the data. You need something like this:
function Update()
if not indi.DATA:hasData(period) or indi.DATA[period) == 0 then
return;
else
saveDataIfNotSaved();
end
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36437
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Requesting Real Volume data downloader

Postby Abschoning » Thu Feb 20, 2020 10:25 am

Thank you.
That made it work :D

I've attached the final working script to this post, if anyone else is interested.
Abschoning
 
Posts: 3
Joined: Sat Feb 15, 2020 12:11 pm


Return to Indicator and Signal Requests

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 8 guests