Page 1 of 1

ChangeParameters()

PostPosted: Sun Aug 30, 2015 9:22 pm
by MrRiversideDude
My strategy has these parameters:

strategy.parameters:addBoolean("AllowTrade", "Allow strategy to trade", "", true);
strategy.parameters:setFlag("AllowTrade", core.FLAG_ALLOW_TRADE);
strategy.parameters:addString("AllowedSide", "Allowed side", "Allow Sell or Buy", "None");
strategy.parameters:addStringAlternative("AllowedSide", "None", "", "None");
strategy.parameters:addStringAlternative("AllowedSide", "Buy", "", "Buy");
strategy.parameters:addStringAlternative("AllowedSide", "Sell", "", "Sell");

Once a position has been opened I want to reset them using the ChangeParameters() function:
I'm not sure of the syntax and when I can call it even after reading the documentation.

function ChangeParameters()
-- Trading parameters
AllowedSide = instance.parameters.AllowedSide;
AllowedTrade = instance.parameters.AllowedTrade;

local name = profile:id() .. " (" .. mode .. " | " .. Strategy .. ")";
end

Thanks in advance.

Re: ChangeParameters()

PostPosted: Fri Sep 11, 2015 5:59 am
by Victor.Tereschenko
You don't need to call ChangeParameters(), it's called by the Marketscope when a user changes parameters of the strategy. Why do you need to change parameters?