Alarm / Signal, if Loop is finished
Author: Supersol
Creation Date: 1/29/2014 5:21 AM
profile picture

Supersol

#1
Dear all,

I would like to have some kind of an alarm / signal, if the loop of one day has been completely proccessed for all signals.

My concern / problem is: all the buy/sell alarms from wealth will be written in a database automatically, but how do I know (if I am not able to check manually), if the current day has already been processed or not (or just partially) or if wealth lab has crashed during the execution and just a part of the datasource (Stocks) has been checked for new signals.

As the system will not generate signals every day, I cannot count on signals as alarm. It should be some kind of signal / alarm that could also be written into the database so everything could be done automatically.

What might be a solution for this issue? It should be something that can be implemented permanently, so the debug mode might not be a correct answer, right?

Kind regards
Supersol
profile picture

Eugene

#2
Hi Mathias,

DataSetSymbols[DataSetSymbols.Count - 1] is the last symbol in a DataSet. If by the time your Strategy has successfully finished processing it, then you can consider everything OK and set a boolean flag "bool finished = true". Otherwise something has gone wrong.

"A simpler approach" in this KB article illustrates what I'm talking about: WealthScript Techniques | Executing some code only once

As an alternative, wrap your code in a try/catch block to handle exceptions.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).