preventing same bot to be attached to same pair with different period or having OrderPeriod() saved - page 2

 
marketeer:
Ok. The only alternative I can think of is a server-side custom backend which store order IDs and corresponding timeframes in a DB. But this looks like an overkill for the task. Do you suggest something else?

The simplest way is to use magic number. Comments are unreliable as they can be changed by the broker.

Depending of the exact needs, you can also save needed data (ticket, timeframe...) as client side. Service-side backend is only needed in very specific cases.

 
angevoyageur:

The simplest way is to use magic number. Comments are unreliable as they can be changed by the broker.

Depending of the exact needs, you can also save needed data (ticket, timeframe...) as client side. Service-side backend is only needed in very specific cases.

Hm. Yes broker changes the comments, but from my experience this was always an addition of some information and never removal. As for, magic numbers - they were already mentioned (as unacceptable for OP), so I did not count them. Yes, Yes, you're right, a client-side solution is also useful, if a user does not work on several different PCs, which would require some sort of synchronization of local caches.
 
marketeer:
Hm. Yes broker changes the comments, but from my experience this was always an addition of some information and never removal. As for, magic numbers - they were already mentioned (as unacceptable for OP), so I did not count them. Yes, Yes, you're right, a client-side solution is also useful, if a user does not work on several different PCs, which would require some sort of synchronization of local caches.

the magic number hack suggested previously is quick and dirty and makes each instance independent of another, but the reason why we need the OrderOpenPeriod() and OrderClosePeriod() is to compare in the history whether our bot had more profits on 15m vs 240m etc... on the same pair over the course of time, think of it like a period hedge on the same pair. Long term down trend but smaller time frames in uptrend and vice versa... 

Reason: