Thread: Ask!
View Single Post
  #1085 (permalink)  
Old 05-04-2008, 03:09 AM
solamax's Avatar
solamax solamax is offline
Junior Member
 
Join Date: Apr 2008
Posts: 12
solamax is on a distinguished road
Thumbs up Dave - you're a blessing:)

Quote:
Originally Posted by Dave137 View Post
PHP Code:
double Buy2_1 iOpen(NULL0Current 0); //Statement in question for crossover!
double Buy2_2 iMA(NULL0500MODE_EMAPRICE_CLOSECurrent 0); 
If I had to zero into a problem area, it would be this code above. There needs to be a cross over for a buy and a sell.

double Buy1_1 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Buy1_2 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back
double Buy2_1 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Buy2_2 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back

double Sell1_1 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Sell1_2 = iMA(NULL, 0, 5, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back
double Sell2_1 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 0);
double Sell2_2 = iMA(NULL, 0, 50, 0, MODE_EMA, PRICE_CLOSE, Current + 1); //1-Back

if(Buy1_1>Sell2_1 && Buy1_2<Sell2_2) Then Buy; // Proper 'UP' crossover has occurred!
if(Sell1_1<Buy2_1 && Sell1_2>Buy2_2) Then Sell; // Proper 'DOWN' crossover has occurred!

Dave
many thanks indeed - i will give it a go
Reply With Quote