[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Treament of Null Value



PureBytes Links

Trading Reference Links

How does AmiBroker treat Null values?

 

When there is no current position then following code does not execute as
the return value is a Null.  But I think it should. When there are open
positions the value is greater than 0 then this piece code executes fine.

 

 

                 if (ibc.GetPositionInfo(Name(),"Avg. cost") <=
LastValue(C))

 

I fixed this situation by first checking  if( ibc.GetPositionSize( Name() )
== 0 )  meaning no existing positions and routing only open positions > than
0 to the above code. 

 

In Hex Null is 000 which is less than all other numbers.  Just not
understanding the situation.  Working with the IB Interface and really like
this capability.    

 

Dave