Page 1 of 1

Pause a strategy automatically

PostPosted: Sun Dec 23, 2018 10:20 am
by Daveatt
Hey guys

Is there a way to pause/kill a strategy instance using some LUA source code ? I'd like to get it paused when the daily loss is below a specific threshold

I'm looking for the command for doing so

Thanks
Daveatt

Re: Pause a strategy automatically

PostPosted: Thu Dec 27, 2018 4:20 pm
by Daveatt
Discovered randomly this thread viewtopic.php?f=22&t=56508&p=84846&hilit=ChangeParameters&sid=39878a5678b9577661af78dcde0053a1#p84846

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.


This answers my question :)

Thanks
Daveatt

Re: Pause a strategy automatically

PostPosted: Fri Jan 18, 2019 8:54 am
by Frustor
Daveatt wrote:Discovered randomly this thread viewtopic.php?f=22&t=56508&p=84846&hilit=ChangeParameters&sid=39878a5678b9577661af78dcde0053a1#p84846

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.


This answers my question :)

Thanks
Daveatt


Thank you! I had the same question!

Re: Pause a strategy automatically

PostPosted: Sun Jan 20, 2019 6:09 am
by Apprentice
public method host:execute("stop");

Brief

Stops the strategy which executed the command

Declaration
Lua
core.host:execute ("stop")

Details

The command is useful for the strategies which works until some condition is met. For example until the chosen trade disappears. After such condition there is no reason to keep strategy working, so the strategy can stop itself.

Only strategies can use this command.

Declared in host