Never mind... I figured out what was wrong in the formula, Actually one of the IF conditions in the formula were using AND function. If (condition1 AND Condition2 AND condition3) { ... ... ... } This was the problem, when the formula is running in the background of AA window, then for some reason it cannot process the IF condition, at least in my case. I changed it to below code, then it worked. Weird part is the IF condition with AND works fine when the symbol is displayed on the chart window. If (condition1) { If (condition2) { If (condition3) { ... ... } } }
Thanks... --- In amibroker@yahoogroups.com, "markedme9" <marked...@...> wrote: > > > Hi, > > I am having a problem with ibc functions, if I use ibc.PlaceOrder within > a couple of IF statements the order function dosent place orders from AA > window. Though both IF conditions are True. In this use ibc.PlaceOrder > is placing orders only if the symbol is displayed on the chart window, > and not for any other symbols found in background of AA window. > > If I use the same ibc.PlaceOrder outside of the IF statements then, > ibc.PlaceOrder works to place orders for any symbol's buy signal found > in AA alanysis. > > Both IF conditions are true, then why is this happening? are there any > limitations/specifications for using ibc function at specific places? > > > > if ( StaticVarGet("SystemInit") == True ) { > > if ( Positions < StaticVarGet ("MaxPositions") ) { > > BuyOrderID = ibc.PlaceOrder(StaticVarGetText ("BuyOrderName " + Symbol), > "Buy", 100, "MKT", StaticVarGet ("BuyPrice " + Symbol), 0, "Day", True); > > } > > } > > > > Thanks... >