get source in strategy

Section for all discussions related to development using Indicore API/SDK.

Moderator: admin

get source in strategy

Postby csshine » Thu Dec 27, 2018 5:53 am

in Ext mode using the helper of strategy development, we use ExtSubscribe to get source then get indicator instance:

Source = ExtSubscribe(1, nil, instance.parameters.TF, instance.parameters.Type == "Bid", "bar");
local indiProfile = core.indicators:findIndicator(instance.parameters:getString("Indicator"));
local params = instance.parameters:getCustomParameters("Indicator");
IndicatorInstance = indiProfile:createInstance(Source, params);


My question is in normal strategy developement(update()), how to get source and get the indicator instance?

Thank you!
Chen
csshine
 
Posts: 11
Joined: Wed Nov 28, 2018 6:16 am

Re: get source in strategy

Postby Apprentice » Thu Dec 27, 2018 7:25 am

Code: Select all
Source
Source = ExtSubscribe(X, nil, instance.parameters.TF, instance.parameters.Type == "Bid", "bar");


function ExtUpdate(id, source, period)

if id~= X then
return;
end

local Value= Source.close[period];

end
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 20385
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: get source in strategy

Postby csshine » Sun Dec 30, 2018 1:51 pm

As I know, the method you provide is using ExtSuscribe when using helper.
If I don't want to use helper, using normal strategy implement like update() method, in such case, How to get source for indicator instance?

Thank you!
csshine
 
Posts: 11
Joined: Wed Nov 28, 2018 6:16 am


Return to Discussions

Who is online

Users browsing this forum: No registered users and 3 guests