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

[amibroker] Re: plot all my trades



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "murthysuresh" <money@xxx> 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.
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/