{"id":23,"date":"2007-04-22T18:55:38","date_gmt":"2007-04-22T18:55:38","guid":{"rendered":"http:\/\/www.amibroker.org\/userkb\/2007\/04\/22\/plotting-trade-prices\/"},"modified":"2007-07-07T19:35:48","modified_gmt":"2007-07-07T19:35:48","slug":"plotting-trade-prices","status":"publish","type":"post","link":"http:\/\/www.amibroker.org\/editable_userkb\/2007\/04\/22\/plotting-trade-prices\/","title":{"rendered":"Plotting Trade-Prices"},"content":{"rendered":"

Instead of the traditional Arrows, which don’t really give you much useful information about your trade (such as filled prices), you can use PlotText() to plot exact Trade Prices, as in the example below:<\/p>\n

\"Plot<\/a><\/p>\n

\/\/Dummy system to generate some signals (Do NOT trade!)
\nShort = Cover = 0;
\nZC = Zig(C,1);
\nBuy = T1 = Ref(ZC,1)>ZC;
\nSell = T1 = Ref(ZC,1)<ZC;
\nBuyPrice = ZC;
\nSellPrice = ZC;
\nEquity(1);
\n\/\/ plotting prices at the correct level
\nPlot(C,\"Close\",colorBlack,styleBar);
\nPlotShapes( IIf(Buy, shapeSmallCircle, shapeNone),colorBrightGreen, 0, BuyPrice, 0 );
\nPlotShapes( IIf( Sell, shapeSmallCircle, shapeNone),colorRed, 0 ,SellPrice, 0 );
\nFirstVisibleBar = Status( \"FirstVisibleBar\" );
\nLastvisiblebar = Status(\"LastVisibleBar\");
\nfor( b = Firstvisiblebar; b <= Lastvisiblebar AND b < BarCount; b++)
\n{
\nif( Buy[b] ) PlotText(\"\\n Buy\\n \"+NumToStr(BuyPrice[b],1.2),b,BuyPrice[b],colorBrightGreen);
\nelse if( Sell[b] ) PlotText(\"\\n Sell\\n \"+NumToStr(SellPrice[b],1.2),b,SellPrice[b],colorRed);
\n}<\/code><\/p>\n

Edited by Al Venosa<\/p>\n","protected":false},"excerpt":{"rendered":"

Instead of the traditional Arrows, which don’t really give you much useful information about your trade (such as filled prices), you can use PlotText() to plot exact Trade Prices, as in the example below: \/\/Dummy system to generate some signals (Do NOT trade!) Short = Cover = 0; ZC = Zig(C,1); Buy = T1 = […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[63],"tags":[],"_links":{"self":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/23"}],"collection":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":0,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.amibroker.org\/editable_userkb\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}