PureBytes Links
Trading Reference Links
|
Hi,
I am stuck here. I am writing the following conditions,
Fail=IIf((Index < 1 AND trend2 < 1) AND C<BBandBot (Close, 20, 0.8 ),
VarSetText("ShortFlag"+Name(),"Fail" ), StaticVarRemove( "ShortFlag") );
Downtrend= IIf(C1<Ref(BBandBot (Close, 20, 0.8), -1) AND C<BBandBot
(Close, 20, 0.8 ) AND trend2<=1 AND Index>1 AND SStrend<0,
VarSetText("ShortFlag"+Name(),"Downtrend" ), StaticVarRemove( "ShortFlag")
);
My problem is that VarGetText always returns the last condition.
I cannot afford a For statement, and IIF should take care of it.
How can I have a flag that tells me:
"The condition hit was (x)"
I need this to pass the result to buy/sell statements.
Any ideas? Any pointers to go on?
I was thinking something like
Fail=IIf((Index < 1 AND trend2 < 1) AND C<BBandBot (Close, 20, 0.8 ),
VarSetText("ShortFlag"+Name(),"Fail" ), StaticVarRemove( "ShortFlag") );
if(VarGetText("ShortFlag"+Name())=="Fail")
{
Sell=(Index < 1 AND trend2 < 1) AND C<BBandBot (Close, 20, 0.8 );
}
--
Kind regards,
Jerry
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/
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.15.26/598 - Release Date: 12/22/2006 3:22 PM
|