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

Re: SV: [amibroker] PlotShapes problem.



PureBytes Links

Trading Reference Links

Jan

DateBar + 5000; is saying 5000 bars after the StartDate.

Assuming daily bars, around 260 trading days per year this is around 19 
years after the StartDate.

Try adding the SetBarsRequired line to the top of your code.

********
SetBarsRequired(10000,10000);
StartDate = ParamDate ( "Start Date" , Date () );
DateBar = ValueWhen ( DateNum () == StartDate, BarIndex () );
P = Param("Bars after Start Date", 50, 50, 5000, 1);
ArrowBar = DateBar + P ;

Plot(C,"", 16,64);
Plot( IIf(DateNum() == STARTDATE,Close,Null), "", colorBlue,2);
PlotShapes ( IIf ( ArrowBar == BarIndex (), shapeUpArrow, shapeNone), 
colorGreen, 0 , L , - 20 );
*******

Regards

ChrisB






Jan Malmberg wrote:
>
> 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@xxxxxxxx ups.com [mailto:amibroker@ yahoogroups. 
> com] *För *wavemechanic
> *Skickat:* den 2 juni 2008 14:24
> *Till:* amibroker@xxxxxxxxx ps.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 <mailto:jan@xxxxxxxxx>
>
>     * To: * amibroker@xxxxxxxxx ps.com <mailto:amibroker@xxxxxxxxxxxxxxx>
>
>     * 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@xxxxxxxxx ps.com
>     <mailto:amibroker@xxxxxxxxxxxxxxx> [mailto:amibroker@ yahoogroups.
>     com] För
>     ChrisB
>     Skickat: den 2 juni 2008 06:09
>     Till: amibroker@xxxxxxxxx ps.com <mailto:amibroker@xxxxxxxxxxxxxxx>
>     Ä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,shapeUpArro w,Null),colorGre en, 0, L , -20);
>     // plots
>     green arrow in default layer (0), 20 pixels below the Low
>     PlotShapes( IIf(XUP,shapeUpArro w,Null),colorLim e, 0, MA2, -35);
>     // plots
>     lime arrow in default layer (0), 35 pixels below the MA2 value
>     PlotShapes( IIf(XUP,shapeDownAr row,Null) ,colorRed, 2, H, -45);
>     // plots
>     red arrow in Daily chart layer (2), 45 pixels above the High
>     PlotShapes( IIf(XUP,shapeDownAr row,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.amibroke r.com/devlog/ <http://www.amibroker.com/devlog/>
>
>     For other support material please check also:
>     http://www.amibroke r.com/support. html
>     <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.amibroke r.com/devlog/ <http://www.amibroker.com/devlog/>
>
>     For other support material please check also:
>     http://www.amibroke r.com/support. html
>     <http://www.amibroker.com/support.html>
>     Yahoo! Groups Links
>
>
>     (Yahoo! ID required)
>
>     mailto:amibroker- fullfeatured@ yahoogroups. com
>     <mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx>
>
>
>
>
>     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
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@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

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