Trying to see if anyone on this group can share some ideas to do this.
----- Original Message ----- 
From: Padhu 
To: [EMAIL PROTECTED] 
Sent: Friday, September 07, 2007 10:52 PM
Subject: [AmiBroker-at] trying to generate a unique order id that gets sent out 
with each alertif output.



Hello,

I am trying to generate a unique order id that gets sent out with each alertif 
output.

I coded this way...Problem is it reinitizles to ZERO for every candle.
>
> buystrategy1=Close > Open;
>
> sellstrategy2= Close < Open;
>
> OrderID=0;
>
> {
>
> if( LastValue(buystrategy1) )
>
> OrderID=OrderID+1;
>
> StaticVarSet("OrderID",OrderID);
>
> }
>
> { if( LastValue(sellstrategy2) )
>
> OrderID=OrderID+1;
>
> StaticVarSet("OrderID",OrderID);
>
> }
>
> Currentorderid=StaticVarGet("OrderID");
>
> "Currentorder_Id is = "+Currentorderid;


Any ideas welcome. Thanks.

Cheers,Padhu

 

Reply via email to