Wednesday, June 16, 2010

Technical optimization problem using computer programming for Bristol-Myers Squibb

Instead of looking at the technical analysis charts, I code an ‘intelligent’ investment detector that crawls historical data of a stock to determine and advise the best timing for investment strategy. The chart is created for BMS, but the approach can be generalized to any asset. For this case, the vehicle gives hint to buy at a time very close to the small trough.


Further application: integrate into algorithmic trading systems.



The sample code for moving average & Oscillator




/*

Calculate Moving Averages

*/

for (i = 0 ; i < bmsRange1 ; i++)

{

bms1[i][1] = pdt[i+bmsFirstDay1][position];

for (j = 1 ; j < shortMA1 ; j++)

{

bms1[i][1] += pdt[i+bmsFirstDay1-j][position];

}

bms1[i][1] = bms1[i][1] / shortMA1;

}




/*

Calculate Oscillator

*/

for (i = 0 ; i < bmsRange1 ; i++)

{

bms1[i][3] = bms1[i][1] - bms1[i][2];

}


I am still enhancing the intelligence and advisory part of the code.




Xem đầy đủ bài viết tại http://feedproxy.google.com/~r/TaiTran/~3/kE4Azefq81w/technical-optimization-problem-using-computer-programming-for-bristol-myers-squibb.html

No comments:

Post a Comment

Popular Posts