Updated to current version and still having a selling/buying at the wrong price going on. Not on every trade. I think I have found the cause. As only a couple of my rules use the script engine I'm not sure how to correct it. Tonight the internet connection dropped for a while 2 times. The first time the rule was into the executeRule section.
The code I'm thinking was involved is the following:
if(trader.get("ApiLag")>10)
{
trader.log("Api lag is to high");
trader.delay(1,"executeRule()");
return;
}
The trouble seems to be that the rule will correctly decide the price is right for trading but if something goes wrong I get a trade as soon as the API is back under 10. I am not 100% positive that is it but I am unable to reliably cause this sell or buy issue with only enabling or disabling a rule. I don't have anything setup to figure out if the API is delaying too much. I will try to figure out if I can get the execute to log the API lag when the trade is placed as that should show if this is the issue. I can't be 100% sure it is as the log of the API lag being to high hasn't to my knowledge been on the console. Occasionally I do not check quickly. This leads me to an issue where I have checked after the 20 lines that the history has saved.
As another question this time on to a small problem I am having with the trader.log. I think I am messing up something but the following should be under 4 items with unlimited characters. I can't say for sure that this line has a problem but it appears the condition should have gotten far enough to trigger it.
trader.log(baseVariable, " < ", trader.get(AskPrice));
I managed to get a code error on validation with a trader.get in front of baseVariable. I should be able to log the values prior to calling execute and see the last values that the trade should be based on.
EDIT: The second enable on the same group didn't cause a trade to happen low. The API went down while the price was too low and nothing happened when the API came back up.