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

Re: FW: FW: [amibroker] price plot help - Tomasz



PureBytes Links

Trading Reference Links

--- In amibroker@xxxxxxxxxxxxxxx, Yuki Taga <yukitaga@xxxx> wrote:
> Can anyone show me the edit that will allow my beginning price bars
> to be visible.  Right now they are invisible, since at the beginning
> of the data neither condition in the code applies.  

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

Yuki,

I think the problem can be solved by initializing Buy and Sell at bar 
0. Try this:


Title = Name() +" - "+ WriteVal( DateTime(), formatDateTime )+" - "+
"Open:"+WriteVal(O,1.0)+" "+" - Hi: "+WriteVal(H,1.0)+" "+
" - Low:"+WriteVal(L,1.0)+" "+" - Close: "+WriteVal(C,1.0)+
" - Volume:"+WriteVal(V,1);


F1=ValueWhen(H<Ref(H,-2) AND Ref(H,-1)<Ref(H,-2) AND 
Ref(H,-3)<Ref(H,-2) AND Ref(H,-4)<Ref(H,-2),Ref(H,-2),1);
F2=ValueWhen(L>Ref(L,-2) AND Ref(L,-1)>Ref(L,-2) AND 
Ref(L,-3)>Ref(L,-2) AND Ref(L,-4)>Ref(L,-2),Ref(L,-2),1);

A=Cross(H,F1);
b=Cross(F2,L);

//oooooooooooooo Delete lines from here down to next line of o's  
/*
Buy=BarsSince(A)<BarsSince(b);
Short =BarsSince(A)>BarsSince(b);
Cover=Buy;
Sell=Short;

Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Cover=ExRem(Cover,Short);
Short=ExRem(Short,Cover); 

X = Buy OR Sell;

Plot( Close, Date() +"\n"+ "O: " + WriteVal( Open, 1.2 ) +"\n"+ "H: " 
+
WriteVal(High, 1.2 ) +"\n"+ "L: " + WriteVal( Low, 1.2 ) +"\n"+ "C: ",
ValueWhen(X,IIf(Sell,colorRed,colorDarkGreen)), styleBar);
*/
//oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo

Buy=BarsSince(A)<BarsSince(b);
Short =BarsSince(A)>BarsSince(b);
Buy[0] = 0; Short[0] = 0;
Cover=Buy; Sell=Short;
Buy = Flip(Buy, Sell); Sell = Flip(Sell,Buy);

Plot( Close, Date() +"\n"+ "O: " + WriteVal( Open, 1.2 ) +"\n"+ "H: " 
+WriteVal(High, 1.2 ) +"\n"+ "L: " + WriteVal( Low, 1.2 ) 
+"\n"+ "C: ",IIf(Buy, colorBrightGreen, IIf(Sell, colorRed, 
colorYellow)), styleBar);

Plot(MA(C,18), "18-day SMA", colorRed, 4);

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

Bill
p.s. I like your concept.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Save up to $400 on all notebooks.
Get the notebook you want with all the features at a price you love. Price after rebates and savings
http://us.click.yahoo.com/gx2HjB/wwSGAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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