PureBytes Links
Trading Reference Links
|
If the conditions are identical for both parts of the IF statement, then
defining them first is fine. If the condition is dependent on "URUSD"
you still need the foreign statement to be sure that is the symbol you
are using. This is because you don't have a "selected" symbol so you
must specify the symbol with foreign (or SetForeign).
--
Terry
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of Andrew Z
Sent: Tuesday, November 15, 2005 03:22
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] FOREIGN function??
G'day all,
I do have a query. When declaring buy/sell/short/cover conditions that
will form part of the buy/sell/short/cover statements, is it correct to
simply declare these conditions BEFORE the IF statement or must they be
declared with both sets of trading rules?
EG:
*** DO CONDITIONS GO HERE?? (A) ***
Buycondition = ....
Sellcondition = ....
ShortCondition = ....
CoverCondition = ....
if( Name() == "EURUSD" )
{
// your trading rules for EURUSD
*** OR HERE (B) ****
Buycondition = ...
Sellcondition = ....
Buy = Buycondition AND ..
Sell = ....
}
else
{
SetForeign("EURUSD");
// here your trading rules for OTHER pair
// based on signals generated from EURUSD (hence SetForeign)
*** AND HERE??? (B) ***
Shortcondition = ....
Covercondition = ....
Short = Shortcondition AND ...
Cover = ....
RestorePriceArrays();
}
I hope I've articulated this properly because I get varying results
depending on where the test condtions are placed.
Thanks,
Andrew.
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 other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
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 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/
<*> 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/
|