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.


Messages - giorgio

Pages: [1] 2
1
Trading System Discussion / Re: ADX and EMA crossovers
« on: November 15, 2010, 12:30:29 am »
Dear sir

I hope the attached file is the one you need

Regards
Giorgio G.

2
Trading System Discussion / Re: ADX and EMA crossovers
« on: October 31, 2010, 03:22:10 pm »
Hi Peunet

I have written your strategy in a AFL.

Before uploading I ask you
is confirmationfor exit at same bar ? I mean 50Average > 20Average or 50Average crosses 20Average ?

I'll upload as soon as I'll finish it.

Regards
Giorgio

3
Amibroker Help / Re: help to understand a line of code in afl
« on: October 29, 2010, 01:07:00 pm »
Hi Jose


Thank for having explained the syntax.
I am trying to understand the assumptions that are concerning the attached afl formula and plot a graph that can well figure it (seemed interesting to me).
Howevere it belongs to the swinging moves family.

Thanks again
Best Regards
Giorgio

4
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

5
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

6
Amibroker Help / Re: Rank tickers
« on: September 01, 2010, 10:41:45 am »
Hello ad

Thank you very much also because I am getting help only by you ......Now I have even to say that as you saw I am not a programmer.......but before posting I am
used to look for a solution by myself ....some times I succeed but mostly not

If you have the patience of explaining me a doubt I'll be very gratefull to you.....

In a loop that access to list of tickers I can VarSet a variable  " Myvar"+i  and give a value to it.... then out of the loop I can use its value with the statement VarGe("ticker"+ ??  "  ......or I get an array of variables with VarGet("ticker") ?? ...in this case I would have an array of values......how to get them ?

Thanks again for your desposability

Giorgio

7
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



8
Amibroker Help / Re: Need help for watch list
« on: August 29, 2010, 11:40:58 pm »
Hi Ad

Thanks for your help ......as I improve in AB.......I post what I have written starting from your suggest and I see it is near your last formula to get top value
It may be of help for someone else

Code: [Select]
WatchlistNumber= Param( "WatchlistNumber", 0, 1, 50,1 );/*enter watchlist number*/

function FindBestSym( Listnum )
{

list = CategoryGetSymbols(categoryWatchlist, Listnum);
bestSym = StrExtract(list,0);

for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
 f = Foreign(sym, "C");
Symroc =LastValue((f-Ref(f,-10))/f*100) ;   
   BestROC = Symroc;
 if( BestROC>x)   
  {       
 bestSym = sym;   
     x = BestROC;   
  }
 }
return bestSym;
}

Best = FindBestSym(WatchlistNumber);

giorgio

9
Amibroker Help / Re: Need help for watch list
« on: August 28, 2010, 05:31:20 pm »
Hello ad

Thanks for your reply;unfortunately if statement does not support working with array function like roc .....and debugger advices to build arrays to compare values........if I have well understood.
Any way I am running in a dark foggy night at closed eyes......

From a teorical point of view I am following this reasonment:

As I said I maintain one list with indexes and 11 list with single Index and its stocks ..... and filter for condition in list Indexes and extend this filter to related stock list........I have maintained in the stock list its  Index because I have supposed to follow the code below but at the end of exploration only tickers of Indexes
are listed in the result window
Certainly I do not code what I want to get....I post my last file....where I tried to create a new watchlist(15) with filtered stocks but I failed and all stocks and Indexes appear in watchlist(15) and only indexes in exploration result window.
I am really down.

Code: [Select]
MonthBegin = Month() != Ref( Month(), -1 );

CharacterFiltered="^";
symbol=Name();
IndexSymbol= StrLeft(symbol,1)== CharacterFiltered;

doubleWeightedAv=0;
AvMov30=EMA(C,30);
AvMov60=EMA(C,60);
AvMov200=EMA(C,200);
WeightFactor=0.5;
doubleWeightedAv=AvMov30*WeightFactor+AvMov60*(1-WeightFactor);


Change=ROC(C,20);
/*------------------------------------------------------------------*/

numList=0;
list=0;
i=0;
MyInd=0;
MyInd3=0;
MyInd2=0;
IndexLinkedToList=0;
//list=CategoryGetName( categoryWatchlist, numList );

for(numList = 1;numList<12;numList++)
{

if(InWatchList(numList))


 {
list = CategoryGetSymbols( categoryWatchlist, numList );
 

for( i = 0; ( sym = StrExtract( list, i ) ) != ""; i++ )
{
SetForeign(sym);
CategoryAddSymbol( sym, categoryWatchlist, 15 );
List15=CategoryGetSymbols( categoryWatchlist, 15 );
RestorePriceArrays();
for( i = 0; ( sym = StrExtract( list15, i ) ) != ""; i++ )
{
fc=Foreign(sym,"C");
VarSet("MyInd",ROC(C,20)>10);// Indicator rate of performance
 
 VarSet("IndexLinkedToList",numList);
    }
   }
  }

}
RestorePriceArrays();










MonthBegin = Month() != Ref( Month(), -1 );

Cond1=Change>10;
Cond2=doubleWeightedAv>AvMov200;
VarGet("MyInd");
VarGet("IndexLinkedToList");








Trade =  MonthBegin AND  MyInd AND InWatchList(15)   ;
TradeList= MonthBegin AND Cond1 AND Cond2  AND InWatchList(IndexLinkedToList);

Filter=Trade   ;
//Filter= Trade;
//Filter= TradeList;
AddColumn(Trade,"Trade");
AddColumn(MyInd,"MyInd");
AddColumn(Change,"ROC");

Please any help is well accepted Many Thanks
Giorgio
 

10
Amibroker Help / Re: Need help for watch list
« on: August 26, 2010, 10:37:23 pm »
Hello Ad

Thanks for your reply (help) .....I have thought of it and I have arrived to the below code.
Resuming that I have put all 11 Indexes in list0 and from list1 to list11 each single Index with its costituent stocks (about 200 ) separately


In this phase I am only writing an exploration to get signals

As well as at this code I am getting a bug "numlist not initialized" ...... Please can you give your comment to keep it working .


Code: [Select]
MonthBegin = Month() != Ref( Month(), -1 );

CharacterFiltered="^";
symbol=Name();
IndexSymbol= StrLeft(symbol,1)== CharacterFiltered;



doubleWeightedAv=0;
AvMov30=EMA(C,30);
AvMov60=EMA(C,60);
AvMov200=EMA(C,200);
WeightFactor=0.5;
doubleWeightedAv=AvMov30*WeightFactor+AvMov60*(1-WeightFactor);




Change=ROC(C,20);
/*------------------------------------------------------------------*/

function PickedList( symbol,numList)
{
for(numList = 1;11;numList++)

//CategoryGetName( categoryWatchlist, numList );
 {


list = CategoryGetSymbols( categoryWatchlist, numList );

 for( i = 1; ( sym = StrExtract( list, i ) ) != ""; i++ )
    {
   
     if( symbol == sym); 

 

    }
  numList = i;
 }
 
}



 



Cond1=Change>10;
Cond2=doubleWeightedAv>AvMov200;






Trade = IndexSymbol AND MonthBegin AND Cond1 AND Cond2 AND PickedList(symbol,numList);


Filter=Trade;
AddColumn(Trade,"Trade");
//AddColumn(Top,"TopIndex");
AddColumn(Change,"ROC");

I would like tha if roc of Index > 10% then even its referring stock list has to be explored for signals
Many thanks
Regards
Giorgio

11
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

12
Trading Resources / Re: Shaff Trend Cycle Information
« on: August 09, 2010, 08:35:43 pm »
Hello


You can already find this AFL on this site

Regards

Giorgio

13
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


14
Hi please do not bother ...... I am newbie in AmiB. and I do a try and look at work that is coming out and modify what does not work
In this attach I use the LinearReg function for Close (in the right way) so I think that now you can backtest for 8 years back
I remain for your opinion

Thanks
giorgio

15
I use new backtester ver.Ami 5.3
I hope you can make it working and I would think for code to make the sys more backtested
g-

Pages: [1] 2