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

SV: [amibroker] PlotShapes problem.



PureBytes Links

Trading Reference Links

Hi Steve and ChrisB,

Thank you both for your very valuable assistance. I have taken some time to study the simple code and I’ve learnt a few things about AFL. We’ll see how long I’ll remember the lessons, I use AB for mainly discretionary trading. Anyway, I am most grateful for the SetBarsRequired suggestion. It works as a charm.

Best regards / JM

 

 


Från: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] För Steve Dugas
Skickat: den 2 juni 2008 17:07
Till: amibroker@xxxxxxxxxxxxxxx
Ämne: Re: [amibroker] PlotShapes problem.

 

Hi - It sounds like you need to add

 

SetBarsRequired( 100000, 100000 );

 

at the top of your code. Otherwise, charting will use QuickAFL ( which uses smaller arrays, a subset of the full arrays ).

 

Also ( and I know it is my code  8 - )  technically IIF is a function and so results are usually  assigned to a variable, so might be better to write

 

PlotShapes( MyDate = IIf( ArrowBar == BarIndex(), shapeUpArrow, shapeNone), colorGreen, 0, L, -20 );

 

 

----- Original Message -----

From: Jan Malmberg

Sent: Monday, June 02, 2008 8:35 AM

Subject: SV: [amibroker] PlotShapes problem.

 

Hello,

I have created, with major help from people here, a time cycle which I am still researching, and it should perhaps not be called an indicator, since it really just displays arrows underneath dates in a fixed manner from a certain start date. Here’s the code (without just one date as an example):

 

StartDate = ParamDate( "Start Date", Date() );

DateBar = ValueWhen( DateNum() == StartDate, BarIndex() );

ArrowBar = DateBar + 5000;

PlotShapes( IIf( ArrowBar == BarIndex(), shapeUpArrow, shapeNone), colorGreen, 0, L, -20 );

 

What happens is that if the start date of the cycle is in chart view, all the dates are plotted correctly. But if I zoom in so that the start date is no longer visible in the chart, after approximately 3 years of bars out of zoom, all the arrows disappear. It is as if the calculation is no longer performed for some reason.

 

Maybe I will need to rewrite the DateBar code. I’m open to suggestions.

 

Best regards / JM

 


Från: amibroker@xxxxxxxxups.com [mailto:amibroker@yahoogroups.com] För wavemechanic
Skickat: den 2 juni 2008 14:24
Till: amibroker@xxxxxxxxxps.com
Ämne: Re: [amibroker] PlotShapes problem.

 

What do you mean by "set the start date" for an indicator?  How are you doing this?  What else is in your code?  Are you using functions such as SelectedValue(), etc.?

 

Bill

----- Original Message -----

From: Jan Malmberg

Sent: Monday, June 02, 2008 7:25 AM

Subject: SV: [amibroker] PlotShapes problem.

 

Hello,
I am most grateful, this solved problem 2. Strangely enough, it only
partially resolved problem number 1. If I set the startdate to 2000-03-07,
when our market topped out, and zoom in, the arrows then disappear when I
reach 2003-03 as the left boundary in the chart. Very strange.
Also, still no arrows in weekly or monthly charts using my calculation. This
however is only a minor issue.
What I would like to achieve now is that the arrows do not disappear when I
zoom in.
I thank you very much for the assistance provided so far.
Best regards / JM

-----Ursprungligt meddelande-----
Från: amibroker@xxxxxxxxxps.com [mailto:amibroker@yahoogroups.com] För
ChrisB
Skickat: den 2 juni 2008 06:09
Till: amibroker@xxxxxxxxxps.com
Ämne: Re: [amibroker] PlotShapes problem.

Jan

Check out the Plotshapes in the Help file, then try this.

MA1 = EMA(C,10);
MA2 = EMA(C, 30);

Plot(C,"", 16,64);
Plot(MA1,"", 17, 1);
Plot(MA2,"", 18,1);

XUP = Cross(MA1,MA2);
XDN = Cross(MA2,MA1);

PlotShapes( IIf(XUP,shapeUpArrow,Null),colorGreen, 0, L, -20); // plots
green arrow in default layer (0), 20 pixels below the Low
PlotShapes( IIf(XUP,shapeUpArrow,Null),colorLime, 0, MA2, -35); // plots
lime arrow in default layer (0), 35 pixels below the MA2 value
PlotShapes( IIf(XUP,shapeDownArrow,Null),colorRed, 2, H, -45); // plots
red arrow in Daily chart layer (2), 45 pixels above the High
PlotShapes( IIf(XUP,shapeDownArrow,Null),colorPink, 3, H, -35); // plots
pink arrow in weekly chart layer (3), 35 pixels above the High

Works for me back to 2000 whether I am zoomed in or out, scroll or not.

Regards

ChrisB






Jan Malmberg wrote:
>
> Hello,
>
> I now have a few new problems with PlotShapes, but managed to get
> ahead well with the help I received previously.
>
>    1. If I use my indicator from, say, 2000, the arrows from the
>       indicator unfortunately disappear when I scroll and zoom in to
>       present times. As a matter of fact, using a date in early 2000
>       as the start date for the indicator's calculations and plots,
>       the arrows seem to disappear when I narrow the window down to
>       2001-2008.
>    2. How do I get the PlotShapes arrows to respect the candlestick
>       upper and lower shadows, so they do not appear just below
>       closing price but instead below the candlestick's deepest part,
>       so to say?
>    3. The arrows do not appear in weekly or monthly charts. This to me
>       is a bit strange since the calculation depends on bars, not
>       actual days. Perhaps the problem lies in selecting a day as a
>       start date for the plot. Could that be it? Anyway, it is not a
>       major issue right now.
>
> There are a few other issues, but I am tired and cannot express them
> in an intelligible way right now. Had something to do with shifting
> stuff into future territory, perhaps XShift does it, I do not know.
> Must sleep now.
>
> Best regards / JM
>


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

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
Yahoo! Groups Links





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

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
Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxps.com
    mailto:amibroker-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxcom

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



No virus found in this incoming message.
Checked by AVG.
Version: 8.0.100 / Virus Database: 269.24.4/1477 - Release Date: 6/1/2008 5:28 PM

__._,_.___

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

__,_._,___