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

RE: [amibroker] Help with Buy/Sell Rules based on my indicator



PureBytes Links

Trading Reference Links

I loaded your code, which looks fine, and I see no arrows. I click backtests and then right-click on results and choose show arrows and they show up provided I have checked Show Arrows in the parameters of the chart.

 

Since this is too much trouble, I then added some specific PlotShapes to your code and they show up all the time. Can’t explain why, but this is how I do all my arrows.

 

Note I have specified Graph0, but you can specify z1, z2 or any other value you have already plotted that is on the PRIMARY axis (does not use StyleOwnScale). In this case, Graph0 is the same as z1.

 

SetPositionSize( 200, spsShares );

 

z1 = C*StochD(15);

z2 = TEMA(z1,3);

zt1 = Cross(C*StochD(15),TEMA(C*StochD(15),3));

zt2 = Cross(TEMA(C*StochD(15),3), C*StochD(15));

Buy = zt1==1;

Short = zt2==1;

Sell  = Short;

Cover = Buy;

 

Plot (z1,"z1",colorBlue);

Plot (z2,"z2",colorRed);

 

"Closing price = " + WriteVal( Close );

"zt1 = " + WriteVal( zt1 );

"zt2 = " + WriteVal( zt2 );

 

PlotShapes(shapeUpArrow * Buy,colorGreen,0,Graph0,-10);

PlotShapes(shapeDownArrow * Short,colorRed,0,Graph0,-7);

PlotShapes(shapeHollowSmallDownTriangle * Sell,colorGreen,0,Graph0,7);

PlotShapes(shapeHollowSmallUpTriangle * Cover,colorRed,0,Graph0,7);

--

Terry

 

| -----Original Message-----

| From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On

| Behalf Of Joel

| Sent: Monday, August 22, 2005 18:10

| To: amibroker@xxxxxxxxxxxxxxx

| Subject: [amibroker] Help with Buy/Sell Rules based on my indicator

|

| Here's my code (modified a bit from it's initial intent because of

| my trouble with buy/sell signal arrows that STILL do not show up):

|

| SetPositionSize( 200, spsShares );

|

| z1 = C*StochD(15);

| z2 = TEMA(z1,3);

| zt1 = Cross(C*StochD(15),TEMA(C*StochD(15),3));

| zt2 = Cross(TEMA(C*StochD(15),3), C*StochD(15));

| Buy = zt1==1;

| Short = zt2==1;

| Sell  = Short;

| Cover = Buy;

|

| Plot (z1,"z1",colorBlue);

| Plot (z2,"z2",colorRed);

|

| "Closing price = " + WriteVal( Close );

| "zt1 = " + WriteVal( zt1 );

| "zt2 = " + WriteVal( zt2 );

|

|

|

| So, why aren't I getting any arrows for buy and sell?  I have arrows

| on in both the indicator and main chart, I see zt1 go to 1 when a

| crossover occurs (same for zt2 when cross under).  NO ARROWS??

|

| Help!

| Zen

|

| ps my original code was:

|

|

| z1 = C*StochD(15);

| z2 = TEMA(z1,3);

|

| Buy = cross(z1,z2);

| Sell = cross(z2,z1);

|

| Plot (z1,"z1",colorBlue);

| Plot (z2,"z2",colorRed);

|

| ... but no arrows!  arrrgh!!!

| which led to the expanded test above, which again... no arrows.

|

|

|

|

|

|

|

| ------------------------ Yahoo! Groups Sponsor --------------------~--

| >

| <font face=arial size=-1><a

| href="">

| 493532/D=groups/S=1705632198:TM/Y=YAHOO/EXP=1124827125/A=2889190/R=0/S

| IG=10r90krvo/*http://www.thebeehive.org

| ">Put more honey in your pocket. (money matters made easy) Welcome to

| the Sweet Life - brought to you by One Economy</a>.</font>

| --------------------------------------------------------------------~-

| >

|

| 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 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/

|

| <*> 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/

|

 



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 other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software Stock investment software


YAHOO! GROUPS LINKS