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

Re: [amibroker] Plotting an Overlay Buy/Sell - Stop Multiple Buys



PureBytes Links

Trading Reference Links

Exrem?

patsgreatdeals wrote:

I am plotting an overlay on a chart to indicate BUY/SELL signals.
Based on what I have I can generate more than one BUY or SELL signal
in a row. This is not an issue. The issue is that I only want to plot
the BUY if the last signal was a SELL. Or plot a SELL if the last
signal was a BUY.

I only want to plot the first Buy or Sell Arrow. I have tried using
BarsSince() but I cannot since BUY has to be initialized first.

Here is the chunk of code for a just started swing system.

----------------------------------------------------------
Buy = C>O AND Ref(C,-1) > Ref(O,-1) AND Ref(C,-2) > Ref(O,-2);
Sell= C<O AND Ref(C,-1) < Ref(O,-1) AND Ref(C,-2) < Ref(O,-2);

//Up until the new signal these will show how many bars.
//How do I test this before? I tried use temporary vars that I
//Initialized to hold the buy/sells but it does not work.

//the next signal is generated above?
"BarsSince BUY :" + WriteVal(BarsSince(Buy ));
"BarsSince SELL :" + WriteVal(BarsSince(Sell));

Short = Sell;
Cover = Buy;

PlotShapes(shapeUpArrow * Buy, colorGreen, 0, Low );
PlotShapes(shapeDownArrow * Sell, colorRed, 0, High );

Thank you,
Patrick


__._,_.___

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

__,_._,___