Page 1 of 1

get source in strategy

PostPosted: Thu Dec 27, 2018 5:53 am
by csshine
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

Re: get source in strategy

PostPosted: Thu Dec 27, 2018 7:25 am
by Apprentice
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

Re: get source in strategy

PostPosted: Sun Dec 30, 2018 1:51 pm
by csshine
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!