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

RE: [amibroker] plot display problem



PureBytes Links

Trading Reference Links

You cannot plot anything to the right of the existing price array from an
indicator, only manual lines etc can be drawn there
The only thing I can suggest to is plot the price bars backwards
Here is one I did a while ago that allows for adding a day's prices to see
the effect on an indicator. You could replace the Stochastics with MA


//INDICATOR
//Allows to add in tomorrows prices to see the effect on the indicator
//Graham Kavanagh March 2003
x = 0.1;//range of prices in the param function
y = 0.01;//step of price within the param function
xo = LastValue(Ref(O,-1));
O = IIf(DateNum()==LastValue(DateNum()),Param("O",xo,xo-x,xo+x,y),O);
xh = LastValue(Ref(H,-1));
H = IIf(DateNum()==LastValue(DateNum()),Param("H",xh,xh-x,xh+x,y),H);
xl= LastValue(Ref(L,-1));
L = IIf(DateNum()==LastValue(DateNum()),Param("L",xl,xl-x,xl+x,y),L);
xc = LastValue(Ref(C,-1));
C = IIf(DateNum()==LastValue(DateNum()),Param("C",xc,xc-x,xc+x,y),C);

Plot(C,"Param input for tomorrows prices",colorBlack,styleCandle);

//Add in your indicator here
Plot(StochD(14),"stochD",colorGreen,styleLine+styleOwnScale);
Plot(StochK(14),"stochK",colorRed,styleLine+styleOwnScale);
//Plot( EMA (C,10),"EMA",colorBlue,styleLine);

Cheers,
Graham
http://groups.msn.com/ASXShareTrading
http://groups.msn.com/FMSAustralia


-----Original Message-----
From: dennisconnaccesstoledocom [mailto:dennisconn@xxxxxxxxxxxxxxxx] 
Sent: Saturday, 30 August 2003 6:50 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] plot display problem


This may be something of a duplicate post, as I haven't yet seen my 
original query in the message index. If so, I apologize; but this 
second attempt might better state my question...

Even though I've searched the discussion boards and the mailing list 
archives, I've not found an answer to this: how does one write a code 
to plot a forward displaced moving average so that it can be 
displayed in the space to the right of the last price bar?

Put another way, if I plot a moving average so that it's displaced 
forward 3 periods, I'd like to be able to plot where it will be in 
the future, 1 to 3 periods past where the most current price data 
ends. Here's the code I'm using:

// Displaced Moving Averages (insert this code into "Built-in / 
Price" edit pane above "//--Indicator-End--" line)
MA1 = Param ("MA1 length", 3, 2, 99, 1);
D1 = Param ("MA1 displacement", -3, -9, 9, 1);
Plot (Ref (MA (C, MA1), D1), "DMA1", 42);

The code works fine, except that the plot of the forward displaced 
moving average is truncated at the last price bar on the chart, so 
that the last 3 values of the MA aren't displayed.

Unless I've missed something in the manual, I can't figure out how to 
code it to display the MA as I'd like. Any solution?

DC



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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