PureBytes Links
Trading Reference Links
|
Dimitris,
1. SetForeign(Sym, True, True ) + Equity() work on both long
& short sides too.
2. On my computer and QP2 database your code generates exactly
the same results regardless
of stock displayed with both short/long sides
3. The reason of your problems may be that your database has
holes in period under test
4. What is the purpose of sending this message in three copies
?
( to group, tj -at- amibroker.com and support - at -
amibroker.com )
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Dimitris
Tsokakis
To: <A title=amibroker@xxxxxxxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx ; <A
title=bugs@xxxxxxxxxxxxx href="">Tomasz Janeczko
; Tomasz Janeczko
Sent: Saturday, October 18, 2003 11:55
AM
Subject: [amibroker] SetForeign()
function
Tomasz,I have the following problem with
SetForeign(SYM,True,True);When I use only Long trades, everything is OK
with the universal G
// Trade the top Equity stock for the MACD
crossoverSTART=DateNum()==1000530
;per=150;//Param("per",150,130,160,5);EVENT=BarsSince(START)%per==0;Plot(10000,"",Cum(1)%2,1);Plot(0,"",1,styleNoLine);G=0;NUM=254;list
= GetCategorySymbols( categoryGroup, NUM );for( i = 0; ( sym = StrExtract(
list, i ) ) != ""; i++ ){SetForeign(SYM,True,True);global
Buy;global Sell;// global Short;global
Cover;Buy=Cross(MACD(),Signal());Sell=Cross(Signal(),MACD());//
Short=Cross(Signal(),MACD());Cover=Cross(MACD(),Signal());E1=Equity();E11=ValueWhen(EVENT,E1);G=IIf(G>E11,G,E11);}Plot(G,"",1,1);
When I change settings to Long and Short and uncomment the above
code, ie
// Trade the top Equity stock for the MACD
crossoverSTART=DateNum()==1000530
;per=150;EVENT=BarsSince(START)%per==0;Plot(10000,"",Cum(1)%2,1);Plot(0,"",1,styleNoLine);G=0;NUM=254;list
= GetCategorySymbols( categoryGroup, NUM );for( i = 0; ( sym = StrExtract(
list, i ) ) != ""; i++ ){SetForeign(SYM,True,True);global
Buy;global Sell;global Short;global
Cover;Buy=Cross(MACD(),Signal());Sell=Cross(Signal(),MACD());Short=Cross(Signal(),MACD());Cover=Cross(MACD(),Signal());E1=Equity();E11=ValueWhen(EVENT,E1);G=IIf(G>E11,G,E11);}Plot(G,"",1,1);
then G is different when change ticker in symbol tree and it
is no more universal.
Does SetForeign() works also with short trades ?Am I
missing something else?TIADimitris TsokakisSend
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to
suggest@xxxxxxxxxxxxx-----------------------------------------Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
Yahoo! Groups Sponsor
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 the Yahoo! Terms of Service.
|