When you set up a "private" array you cannot directly compare that array with any array set by AFL. If you look at DateNumOfBuy[0] which has only a few members with Buy array which may have hundreds then you ill be comparing similar it to buy[0[], not what you wnat. Unless you use a loop and compare the date in your array to the one in the bar they will never be in sync. Using a loop in this way will make auto analysis much more difficult or totally incorrect.
Buy why don't you just use buyprice, also sellprice, coverprice and shortprice, to keep your trade prices and then plotshapes to show them on your chart? This will keep all the arrays in sync. Set buyprice to the value of C when the condition is true. For example, if you use MA crossing then put the value of one of the MAs in BuyPrice. If you use C it will end up being the close of the bar, not necessarily the price when the condition was true. Even the MA price may not be exact but it will be much sloser to the real trading value. buyprice = iif(buy condition, value when the condition is true, 0); then chart the buy point with either PlotShapes(Buy * shapeUpArrow, colorgreen); PlotShapes(iif(Buyprice, shapeUpArrow, 0), colorgreen); Plot the buyprice so you can click on the bar and see its value, plot(buyprice, "\nBuyPrice", colorblack, stylenoline | styleownscale); Setting buyprice will also let you use it in automatic analysis. Barry --- In [email protected], "murthysuresh" <[EMAIL PROTECTED]> wrote: > > i am trying to chart my trades including the buy and sell points. so my > feed into afl is going to be like following as it may be multiple > trades. > DateNumOfBuy[0] = 1080722; > DateNumOfBuy[1] = 1080723; > > Buy=IIf(DateNum()==DateNumOfBuy,True,False); > > when i actually scan it, the buy signal never gets a true. i am > obviously missing something. appreciate your response. >
