How to use custom indicators in my code?

Moderator: admin

How to use custom indicators in my code?

Postby MarkJoy » Sun Nov 27, 2016 9:30 pm

Hello,

I am trying to use custom indicators in my code but I always got "nil" as return value.
Code: Select all
myindi = core.indicators:create("myindi", source);


When I use standard indicators, I got table as return value.
Code: Select all
myEMA= core.indicators:create("EMA", source);


Tried to copy myindi.lua into F:\Gehtsoft\IndicoreSDK3\indicators\standard and F:\Gehtsoft\IndicoreSDK3, but it does not work.


How to use custom indicators in my code?
MarkJoy
 
Posts: 26
Joined: Sat Oct 01, 2016 7:53 am

Re: How to use custom indicators in my code?

Postby Apprentice » Mon Nov 28, 2016 5:22 am

Can you share your complete code.
Indicator and strategy.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: How to use custom indicators in my code?

Postby MarkJoy » Mon Nov 28, 2016 5:51 am

Hello Apprentice,
I found out how to use custom indicator in code.
1> The custom indicator name must be in UPPER CASE even when the real name is not. Example: the file is myindi.lua, then the code should be:
Code: Select all
myindi = core.indicators:create("MYINDI", source);

2> To use it in debugger, myindi.lua has to be added into the project which is calling myindi.lua

Another question: As I understand, indicator only support output as stream. Is there a way to add a custom output/data such as a table?
Example, I want to get data of indicator as:

CustomOutput = {a=6, b=7, str="this is a string"}

Thanks & Regards,
Mark
MarkJoy
 
Posts: 26
Joined: Sat Oct 01, 2016 7:53 am



Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 10 guests

cron