rememring the figures from the past session
rememring the figures from the past session
11 Oct 2018, 18:42
Dear Panagiotis! Hi!
What I am asking maybe quite difficult, maybe not
let us say, I enter the market order, but do not want to leave stoploss on server
So, I keep it in the bot. But, for example, there is an electricity breakdown
How will my bot know the specific figure of a stop loss.
Or may be there is a way that the bot remembers the specific figures?
Best regards, Alexander
Replies
PanagiotisCharalampous
12 Oct 2018, 09:49
Hi Sasha,
The best approach to this would be to keep this information saved in a file i.e. records with position id, SL, TP. You should be updating this file every time the information changes while the cBot runs and delete it on cBot stopping. On starting the cBot, you should be checking if the file exists. If yes, then it means the cBot was closed unexpectedly, therefore you should read the file and update your variables accordingly.
Let me know if this was helpful.
Best Regards,
Panagiotis
@PanagiotisCharalampous
alexander.n.fedorov
12 Oct 2018, 16:30
Hi, Panagiotis!
I think, I found some other solution, which is acceptable for my case.
Basically what it does, it takes the position, finds its entry time, by using "do while" loop finds the indicator value in a differet timeframe, and uses the original algorithm for the stops etc.
But you are right , the most conceptual approach would be to have the data stored not in file (files are different on different machines) but on some kind of SQL server in the database with and external address.
By doing that you become completely secure.
Regards, Alexander
@alexander.n.fedorov
PanagiotisCharalampous
12 Oct 2018, 16:49
Hi Sasha,
Indeed a database is the most proper way to do this. I just thought it would be overengineering for such a case.
Best Regards,
Panagiotis
@PanagiotisCharalampous
alexander.n.fedorov
11 Oct 2018, 19:13
Or maybe, you could find the falues of a specific indicator (let us say Boulinger Bands), knowinng the position entry tirme?
@alexander.n.fedorov