Thread: Ask!
View Single Post
  #1082 (permalink)  
Old 05-03-2008, 04:05 PM
Dave137 Dave137 is offline
Senior Member
 
Join Date: Oct 2007
Posts: 154
Dave137 is on a distinguished road
Smile

Quote:
Originally Posted by solamax View Post



Can I ask anybody to have a look at my code to see where it's wrong please....I am not much of a programmer and would appreciate some assistance with this.


many thanks in advance

also i just realized something - theres a guy called Ben Taylor selling an EA that looks almost exactly like the one that coder's guru programmed - maybe thats one of his clients - lol

if its not - we should let coders guru know about this
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

Last edited by Dave137 : 05-03-2008 at 04:40 PM.
Reply With Quote