Reseting Bot and Increasing lot automaticaly

Created at 20 Jan 2025, 19:35
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
GR

grkiceda

Joined 02.01.2025

Reseting Bot and Increasing lot automaticaly
20 Jan 2025, 19:35


I am totally new in this field and I try to learn something new every day. I've been researching for days and trying to use AI to create a piece of code to implement in a bot. I have not succeeded in this until this moment. I am interested in whether it is possible to make a code to reset the bot itself after each closed position? Second, is it possible to reset the bot after a loss and enter the next position with a 4x bigger lot? Thanks in advance to anyone who is willing to solve my dilemma.

Dragan


@grkiceda
Replies

firemyst
22 Jan 2025, 00:20 ( Updated at: 22 Jan 2025, 10:05 )

I am interested in whether it is possible to make a code to reset the bot itself after each closed position?

Yes. When a position is closed, just reset all your internal parameters/properties. for instance, if you have a counter, reset it to zero; if you have some sort of “flag”, reset it to its default value; if you have any objects, reinitialize as appropriate.

 

Second, is it possible to reset the bot after a loss and enter the next position with a 4x bigger lot?

Yes. In your bot's code, when a position is closed, check to see if it did for a loss.

If it did lose, then update your position-size parameter value as appropriate.

 

In simplistic terms. Obviously the complexity of the implementation will depend on how clean your code is.


@firemyst