Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - giorgio

Pages: [1]
1
Amibroker Help / help to understand a line of code in afl
« on: October 27, 2010, 11:29:22 pm »
Hi all
Please
Can anyone explain me the meaning of the line of code in attached afl ?

I don't understand the syntax.
The line is : if(pd%2==0 AND i > pd/2) X = sin((i-1)*a);

Many thanks

Giorgio

2
Amibroker Help / Foreign bars access
« on: September 29, 2010, 12:28:12 am »
Hello

How do I access to data bars of foreign symbol ? SetForeign and foreign functions gives access to O--H--L--C--V--I data..... I would like to get number of bars in other than current symbol.......  TotBars= EndValue(BarIndex())-BeginValue(BarIndex()) for using in rotating tickers with different historical period.
It seems to me that EnableRotationalTrading works only when it can calculate PositionScore on all tickers.
 I need to do something like........ No data bars ?? ok : no rotate.

Thanks for help
Giorgio

3
Amibroker Help / Rank tickers
« on: August 30, 2010, 02:31:25 pm »
Hello


I got the code below and modified it for my use in explorations but I am missing something ....debugger ask me to define a variable for filter function
I tried to fix it but I failed

Please Can you fix it ?

Code: [Select]
/*
returns the Rank of a ticker in a WL for a given indicator

*/
Value=1;
listNum=0 ;//enter watchlist number
list = GetCategorySymbols( categoryWatchlist, listnum );

for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
SetForeign(sym);
VarSet("MyInd"+i,MFI(14));// Indicator
/*
VarSet stores the Value of MFI
ticker 0 has its value of MFI stored in MyInd + 0
ticker 1 has its value of MFI stored in MyInf + 1 ...
*/
Rank =1;// Initialize the Rank

for( j = 0; ( item = StrExtract( list, j ) ) != ""; j++ )
{
SetForeign(item);
VarSet("ThisInd"+j,MFI(14));//Indicator
VarSet("Rank",Value + IIf( VarGet("MyInd"+i) < VarGet("ThisInd"+j),1,0));
/*
VarGet returns the value of VarSet
Every value of MyInd + i is compared to every Value of ThisInd + j
and the Rank in incremented of + 1 every time the Ind is < to others.
*/
RestorePriceArrays();// to get out the influence of SetForeign
}

}


Filter = VarGet("Rank");

AddColumn(Rank,"Rank");

Thanks
Giorgio



4
Amibroker Help / Need help for watch list
« on: August 23, 2010, 12:12:28 am »
Hello

I would set up a system on watch lists ..... please suppose :
1)In list0 there 5 tickers which are Indexes
2) In lists from 1 to 5 there are stock  costituent symbols for each of index in list0

I would like to rank tichers in list0 so that I can select  2 top Indexes and then proceed to analyze the watch list that is referring to 2 top Indexes.....
rank the watch list for trading

In other way to say : If performance of Index1 and Index3( in watch list0>4%) then trade on (ranked stocks) list1 and list3

I am looking for a way to link the list
Is it possible in AB ? Can you give me a guide line to get it done ?

Many Thanks

Giorgio

5
Amibroker Help / Neutral Market
« on: July 28, 2010, 02:49:50 am »
Hello to all

In which way can I code to know the number of open positions (long and short separately) in my TS ?

I  state MaxOpenPositions = 10 and I would like that Long postions were equal to short positions or at the worst I would have that difference between long and short is = 1.

I mean 5 long pos and 4 short pos (this is only one case among all possibilities) another is 0 long pos and 1 short pos ...........of course 6 long pos and 5 short pos is a discharged case.

Can anyone give the road to get it done?
Thanks giorgio


6
Amibroker Help / scaling in-out
« on: May 15, 2010, 10:35:00 am »
Hi to all

I would be happy if anyone could trace the road to solve this matter : to scaling in at the next signal buy.......I mean that I have in the TS more than two signals...
something like buy--buy---buy-etc(I do not use exRem so I take in consideration to increment the size of the position) when signal is sell : I close whole position.
Same thing for going short.
I don't succeed in writing the condition.
Have I to call BacktesterObject ?

Thanks Giorgio

Pages: [1]