|
Post by ricardorix on Jul 10, 2021 22:36:06 GMT
I would like to create a variable in a function I can write to.
For example in a bet trigger I will call a function. LayRise(@best_lay_price)
Inside the function I would like to save the @best_lay_price to system variable so the next time the function is called, I can see if the price has increased since the last time.
If I simply create a variable in SysVariables like @lay1, can I then inside the function write to it?
set @lay1 = @best_lay_price;
so all of it would be
declare @rise bit; set @rise = (@lay1 < @best_lay_price);
-- save the price for next time... set @lay1 = @best_lay_price;
RETURN @rise; SysVariable:
[Name] lay1 [Declaration] declare @lay1 numeric(18,2) [Funct] select @lay1
|
|
|
Post by Ipposnif on Jul 11, 2021 15:30:01 GMT
It is not possible to update a variable within an Ipposnif strategy. This is because every check of the trigger conditions is a stand-alone SQL call to fun_SqlCond (for the trigger conditions) and fun_SqlExpr (for the sizes and prices), and there is no persistence between two different calls.
Maybe in the future, I will add some user variables for this scope.
|
|