Page 1 of 1

IndicoreSDK: Target reached, Lua Code Simulate Pause/Restart

PostPosted: Fri Jul 26, 2013 2:26 pm
by samade123
Hi everyone,

I need help with Pause/Restart strategy in lua code.

Question: Is there any way to restart my strategy using lua code in Indicore/SDK without using the menu item: TSII -- Charts/Alerts and Trading Automation/Configure strategies and alerts/Pause/Restart whenever limit/profit target is reached?

I have tried check and changeparameters procedures but unfortunately they do not work for me.

The Pseudo code of My strategy has the following structure:

function Init()
CheckParameters()
end

function Prepare(nameonly)

end

function update()
process_data()
if Target_Reached then
BankTheGain()
loop to prepare(false) or any function to simulate Pause/Restart
end

Kindly help.

Forum member,

Re: IndicoreSDK: Target reached, Lua Code Simulate Pause/Res

PostPosted: Sat Jul 27, 2013 2:43 am
by Apprentice
Unfortunately not.
U have to use Strategy algorithm, while it is still active,
to go to "not trading" or "inactive" state.

Re: IndicoreSDK: Target reached, Lua Code Simulate Pause/Res

PostPosted: Wed Jul 31, 2013 5:04 am
by samade123
Thank you apprentice. Kindly elaborate "to go to "not trading" or "inactive" state" if you please.

Re: IndicoreSDK: Target reached, Lua Code Simulate Pause/Res

PostPosted: Thu Aug 01, 2013 1:59 am
by Apprentice
As you can not turn strategy on and off as you want.
U have to prevent trade execution, during the periods
when it is not desired, from within strategy code.