I notice that when my API client launches 2 instances
of the same strategy (not from .jfx file, but just Java class object
instantiation from within a jar file), that a given class file gets an
identical Strategy ID. This seems to be a checksum calculated
from the class file's byte pattern, that's my guess:
Instance #1
Strategy "HyperBotDCSMgr" Strategy ID: F6648214B47FF11F9BF33F6076369C91
Select Instrument"=[EUR/JPY]
Instance #2
Strategy "HyperBotDCSMgr" Strategy ID: F6648214B47FF11F9BF33F6076369C91
Select Instrument"=[GBP/JPY]
What is the purpose of the Hex looking Strategy ID value?
Since we get ISystemListener.onStart processId for example, 37 for one
instance #1, and 131 for another instance #2. These are our
Strategy "instance id's" (aka "processIds").
I see that IClient.stopStrategy (processId) can be used to forcibly
terminate an IStrategy instance. I assume that's the same processId which
is delivered in ISystemListener.onStart, is that correct?
If I can get a reference to a Strategy instance by using the processId,
then I won't have to maintain a separate HashMap to my running
Strategy instances, and it seems that can be done as follows:
I see that IClient.getStartedStrategies returns Map<Long,IStrategy>
and the Long entry appears to be the "processId". So this means
I won't have to maintain a separate Map to individually address my
Strategy instances.
And so long as I do not maintain a persistent reference to my
Strategy instances when they either terminate or are forcibly
shut down, then they WILL BE garbage collected, is that correct?
I guess I could verify that by implementing a finalization
callback......
HyperScalper