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

[amibroker] Re: SetForeign() function



PureBytes Links

Trading Reference Links

Tomasz,
thank you for the quick response.
--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
> 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

My database has no holes.
I use amibroker 4.44.1 Oct12, 2003
The problem was for both Long/short before the Setforeign(sym, true, 
true) function, as you remember.
Now the problem is limited but still exists.
What can I do ?
Dimitris Tsokakis
> 4. What is the purpose of sending this message in three copies ?
> ( to group, tj -at- amibroker.com and support - at - amibroker.com )
It is your request, just in case you donīt see this list messages...
> Best regards,
> Tomasz Janeczko
> amibroker.com
>   ----- Original Message ----- 
>   From: Dimitris Tsokakis 
>   To: amibroker@xxxxxxxxxxxxxxx ; 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 crossover
>   START=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 crossover
>   START=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?
>   TIA
>   Dimitris Tsokakis
> 
>         Yahoo! Groups Sponsor 
>        
>        
> 
>   Send BUG REPORTS to bugs@xxxx
>   Send SUGGESTIONS to suggest@xxxx
>   -----------------------------------------
>   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.


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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 http://docs.yahoo.com/info/terms/