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

RE: [amibroker] Question on ValueWhen usage



PureBytes Links

Trading Reference Links

Hello,

basically your code checks if current close is < than current close. 
Therefore you can't receive buy signals.

Not sure what you are trying to code, but probably you want to buy when the
close is 10% below the highest close from the last 250 bars.
The following code would do this:


HC = ValueWhen(C == HHV(C, 250), C);
Buy = C < 0.99 * HC; // Buy if close dropped down by 10% from Highest Close

Plot(C, "Close", colorBrown, 128);
Plot(HC, "HC", colorPaleGreen, 1);
PlotShapes(Buy * shapeUpArrow, colorGreen, 0, L, -12);


Kind regards
Thomas Zmuck
www.patternexplorer.com


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of mo_means_go
Sent: Wednesday, January 02, 2008 10:52 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Question on ValueWhen usage

I have the following pullback test for a buy:

Buy_Requirement = IIf ( C < 0.90 * ValueWhen ( C > Ref ( HHV ( C, 250
), -1 ), C), 1, 0 );
Buy = Buy_Requirement == 1;

I am not generating signals. Am I using this incorrectly for what I'm
trying to accomplish? Any help would be appreciated.

Thanks,

Mo
 


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/
 

<<attachment: winmail.dat>>