Default path

Moderator: admin

Default path

Postby robocod » Mon Apr 11, 2016 5:42 am

Where is the default path for context:loadPicture() function?

For example if I do context:loadPicture("test.png") where will it look?

In the previous version of MarketScope it used to look in "C:\Program Files (x86)\Candleworks\FXTS2", so I could put my graphics there (or inside a directory at that level).

However, I just noticed that this no longer works.

I have a tried a few things, but I can't find the path.

I prefer not to give absolute path, e.g. "C:\Program Files (x86)\Candleworks\FXTS2\graphics" because this depends on the where the user installed it (and also on Windows version if they still use older version of Windows). Alternatively, if there is a way to find the install path this could also be used.

Please help, as I need to fix an indicator that doesn't work properly due to the change.
User avatar
robocod
FXCodeBase: Graduate
 
Posts: 298
Joined: Thu May 10, 2012 4:25 pm

Re: Default path

Postby Julia CJ » Wed Apr 13, 2016 3:56 am

Hi Robocod,

By default you can find the “loadPicture()” function in the indicator folder (if loading from the indicator):
C:/[Program Files/Candleworks/FXTS2]/Indicators/Custom/
You can get the FXTS location using function core.app_path()
The function is employed by all standard strategies
dofile(core.app_path() .. "\\strategies\\standard\\include\\helper.lua");
Julia CJ
 

Re: Default path

Postby robocod » Wed Apr 13, 2016 5:02 am

Julia CJ wrote:Hi Robocod,

By default you can find the “loadPicture()” function in the indicator folder (if loading from the indicator):
C:/[Program Files/Candleworks/FXTS2]/Indicators/Custom/
You can get the FXTS location using function core.app_path()
The function is employed by all standard strategies
dofile(core.app_path() .. "\\strategies\\standard\\include\\helper.lua");


Thanks. I found it. This appears to be a change from before (or maybe it checked multiple paths in last version of TS).
User avatar
robocod
FXCodeBase: Graduate
 
Posts: 298
Joined: Thu May 10, 2012 4:25 pm


Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 6 guests