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

[amibroker] Re: Plotting shapes in for() loop



PureBytes Links

Trading Reference Links

Hi Pip,
Hope the following might be helpful to you.




/*
Buy / Sell Indicator based on a % Inrease / Decrease
*/

Setpoint = 8;
ScanPeriod = 40;

GraphXSpace= 1000;
Color = IIf(C >=Ref(C,-1),colorGreen,colorRed);
Y = 50;

for(N = 1; N <= ScanPeriod; N = N + 1)
{
Change = ((C - LLV(C,N)) / C) * 100;
Buy = Cross(Change,Setpoint);

Change = ((C - HHV(C,N)) / HHV(C,N)) * 100;
Sell = Cross(-Setpoint,Change);

Graph1 = Y;
PlotShapes(shapeSmallCircle,Color,0,Y, Offset = 0);
PlotShapes(IIf(Buy,shapeUpArrow,shapeNone),colorGreen,0,Y-1);
PlotShapes(IIf(Sell,shapeDownArrow,shapeNone),colorRed,0,Y+1);
} 
Title = " " + Name() + " - " + EncodeColor(colorRed) +Setpoint + "%" 
+ EncodeColor(colorGreen) + "  Buy " + EncodeColor(colorBlack) 
+ " / " + EncodeColor(colorRed) + " Sell  -  " + ScanPeriod + " 
Period Scan "; 


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 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Yahoo! Groups Links

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

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/