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

Re: [amibroker] Simple plottext format



PureBytes Links

Trading Reference Links

Grover, I see that GRANT and I were both happy to see that you made a Plot text that would work without loops.

My only problem with plotshapes , is that Amibroker only allows the use of digits 1 through 9.

I want to be able to plot up to the number 1000. I would use c1 for the number 101, c2 for 102, 2c1 for 201, 2c99 for 299, and so on.

If plotshapes can be made to count to 1000 using the above method, then I could continue using plotshapes, however, I would still

like to know how to use plot text using a very simple format.

Grover>Then we show the actual Close price C with Lastvalue(C). We have to say
lastvalue © because c is an array, and the function needs a number, not an array.

dr is a dark red  rangebound CCI plot line in a custom indicator window, therefore it is an array.

br is a brown rangebound CCI plot line in a custom indicator window, therefore it also is an array.

When the condition is such that dr>br, then a one is returned.

When dr is NOT >br, then nothing is returned.

dr>br means that the darkred CCI line plotted on the custom chart is above the brown line., and puxgn=Cross(pu,gn);

Dips and tops are as shown below.

bkdip=bk>Ref(bk,-1) AND Ref(bk,-1)<=Ref(bk,-2);bktop=bk<Ref(bk,-1) AND Ref(bk,-1)>=Ref(bk,-2);

Therefore, since Buy 9 is either a one, or a zero, and not an array, plottext should be able to do what I am looking for, right??

Below, is the exact code and plotshapes that I am now using.

seq9=dr>br AND br>pg AND pg>pu AND pu>yl AND yl>gn AND yl>bk AND bk>rd AND bk>wh AND rd>bu AND wh>bu AND bu>dg;

dps9=dgdip;

xes9=Sum(ylxgn AND puxgn,2);

tps9=Sum(gntop AND putop AND Sum(rdtop AND whtop AND bktop AND yltop,2),3);

Buy9=seq9 AND dps9 AND xes9 AND tps9 AND xes9;

PlotShapes(IIf(Buy9,shapeDigit9+shapePositionAbove,shapeNone),colorRed);

Below here is the Grover plottext code loaded with my custom codes in order to make it really clear what I am trying to accomplish.

IIf(Buy9,PlotText("\nBuy9"+"Buy9="+LastValue(Buy9),BarCount,LastValue(Buy9),colorred),0);

This syntax did not cause an error, but I saw nothing appear in the coustom indicator chart pane.  Ron D

===========================================================================================================

----- Original Message -----
Sent: Monday, December 03, 2007 11:51 PM
Subject: RE: [amibroker] Simple plottext format

Ron,

You are not the only one with problematical brain gaskets!

Here is some simple plottext code:  I pasted  in some other code to insure that it works.

PlotText("      "+" C= "+LastValue(C),BarCount,LastValue(C),colorBlack);

PlotText("\n      "+" V= "+LastValue(V),BarCount,LastValue(C),colorBlack);

Here is the deal. 

The first line shows the closing price just to the right of the last bar on any chart.

The second line shows the Volume just to the right of the last bar and one space below it.

Now look at the construction of the first line, and the second line has the same construction.  So we will look only at the first line.

At the beginning of the first line after Plottext, the spaces in quotes say I want that much space to the right.

Then we print ?C= ?

Then we show the actual Close price C with Lastvalue(C).  We have to say lastvalue © because c is an array, and the function needs a number, not an array.

Next we want the X, and Y position.  They have to be numbers also, not arrays.  So, barcount is a number, Good, that takes care of X.  Now, how high is it on the screen (in dollars).  There we use our old buddy Lastvalue(C) again.

Finally we say what color.

Oh, and one more thing: On the second line the \n says put the second line one space below the first line stuff.

Final item: watch out for arrays, we need numbers!!

Grover Yowell

From: amibroker@xxxxxxxxxps.com [mailto:amibroker@yahoogroups.com] On Behalf Of Ronald Davis
Sent: Monday, December 03, 2007 7:38 PM
To: amibroker@xxxxxxxxxps.com
Subject: [amibroker] Simple plottext format

I would like to be also be able to use plottext(); in the same simple AFL format that I use for plotshapes.

The plotshapes that I have pasted below works fine, and it is done with AFL that I understand.

PlotShapes(Buy*shapedigit1+shapePositionAbove,shapeNone),colorred)

I have never been able to figure out how to make plottext work because I am not capable of understanding the help manual explanation of plottext();

There may be others like myself who would like to be able to plot text in a chart using the same simple format that I understand, and that I use for plotshapes. I have pasted the Plotshapes() and PlotText() formats below as an example of the simple kind of format that I am looking for. Obviously these formats don't work.

PlotShapes(IIf( Buyb,PlotText("buy one"),0));

PlotText(IIf( Buyb,PlotText("buy one"),0));

This description from the help manual is way beyond my knowledge, and I have no need to spend a lot of time understanding loops because I don't need them, and I don't want to blow one of my brain gaskets trying to learn how.

Unless, of course, someone has previously explained in very detailed english how to understand this help manual explanation of plottext(). Ron D

Plot(C,"Price", colorBlack, styleLine );
Plot(MA(C,20),"MA20", colorRed );

Buy=
Cross( C, MA(C,20 ) );
Sell=
Cross( MA( C, 20 ), C );

dist =
1.5*ATR(10);

for( i = 0; i < BarCount; i++ )
{
if( Buy[i] ) PlotText( "Buy\n@" + C[ i ], i, L[ i ]-dist[i], colorGreen );
if( Sell[i] ) PlotText( "Sell\n@" + C[ i ], i, H[ i ]+dist[i], colorRed, colorYellow );
}

PlotShapes( Buy * shapeUpArrow + Sell * shapeDownArrow, IIf( Buy, colorGreen, colorRed ) );

__._,_.___

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




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___