IndicoreSDK: Target reached, Lua Code Simulate Pause/Restart

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

Moderator: admin

IndicoreSDK: Target reached, Lua Code Simulate Pause/Restart

Postby samade123 » Fri Jul 26, 2013 2:26 pm

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,
samade123
 
Posts: 11
Joined: Fri Aug 19, 2011 8:29 am
Location: London

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

Postby Apprentice » Sat Jul 27, 2013 2:43 am

Unfortunately not.
U have to use Strategy algorithm, while it is still active,
to go to "not trading" or "inactive" state.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18078
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

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

Postby samade123 » Wed Jul 31, 2013 5:04 am

Thank you apprentice. Kindly elaborate "to go to "not trading" or "inactive" state" if you please.
samade123
 
Posts: 11
Joined: Fri Aug 19, 2011 8:29 am
Location: London

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

Postby Apprentice » Thu Aug 01, 2013 1:59 am

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.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 18078
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia


Return to Discussions

Who is online

Users browsing this forum: No registered users and 1 guest