Can anyone answer why this may not work?

 

double M14A=iMA(Symbol(),240,14,0,MODE_SMA,PRICE_OPEN,1);
double MDHC=iMACD(Symbol(),240,12,25,9,PRICE_CLOSE,MODE_MAIN,8);

if(DayOfWeek()!=1 && Hour()==0 && Minute() < 1)
{
if (Seconds() < 10)
{
GlobalVariableDel("buy");
GlobalVariableDel("sell");
GlobalVariableDel("BUY");
GlobalVariableDel("SELL");
GlobalVariableDel("STOP");
Print("Reset has taken place");
}
if (Seconds() < 20)//looks to set globalvariables


{
if(M14A > M14B && M55A > M55B && MDHA > MDHB)
{
GlobalVariableSet("BUY",1);//sets strong BUY mode
Print("BUY mode has been set");
}
if(M14A < M14B && M55A < M55B && MDHA < MDHB)
{
GlobalVariableSet("SELL",1);//sets strong SELL mode
Print("SELL mode has been set");
}
if(M14A > M14B && M55A > M55B && MDHA < MDHB)
{
GlobalVariableSet("buy",1);//sets weak buy mode
Print("buy mode has been set");
}
if(M14A > M14B && M55A < M55B && MDHA > MDHB)
{
GlobalVariableSet("buy",1);//sets weak buy mode
Print("buy mode has been set");
}
if(M14A < M14B && M55A > M55B && MDHA > MDHB)
{
GlobalVariableSet("buy",1);//sets weak buy mode
Print("buy mode has been set");
}
if(M14A < M14B && M55A < M55B && MDHA > MDHB)
{
GlobalVariableSet("sell",1);//sets weak sell mode
Print("sell mode has been set");
}
if(M14A < M14B && M55A > M55B && MDHA < MDHB)
{
GlobalVariableSet("sell",1);//sets weak sell mode
Print("sell mode has been set");
}
if(M14A > M14B && M55A < M55B && MDHA < MDHB)
{
GlobalVariableSet("sell",1);//sets weak sell mode
Print("sell mode has been set");
}
}
Print("Sessions trade mode has been set");
}

______________________________________________________________________________________________________________________________

I did get the EA to "drop" into the first called set of conditions as the platform did show the Print "Sessions trade mode has been set"...... however, none of the global variables were set as none of those print functions showed up! I can't see how this would not work...is it too complicated to be figured inside 10 seconds? Any help would be truly appreciated!!!!

 

I can just guess:

You have conditions, like:

if(M14A > M14B && M55A < M55B && MDHA < MDHB)
but you don't have variables M14B, M55A, M55B,MDHA,MDHB, so conditions anytime egual false and don't execute.

 
Roger wrote >>

I can just guess:

You have conditions, like:

if(M14A > M14B && M55A < M55B && MDHA < MDHB)
but you don't have variables M14B, M55A, M55B,MDHA,MDHB, so conditions anytime egual false and don't execute.

Roger, thanks for the look, however, all the variables that are defined in the if statements are there.....I just did not want to list them all. The ones that are missing are defined the same way as double......any other thoughts?

 
So, print all of them and you can figure out what you have.
 
Roger wrote >>
So, print all of them and you can figure out what you have.

I did not even get "Reset has taken place".......if there is no tick within 10 seconds, will it not work? I do have Print where I need it to see which one would work or if it worked at all and it did not........

 
forexman05 wrote >>

if there is no tick within 10 seconds, will it not work?

won't work. Your construction is weak.

 
Roger wrote >>

won't work. Your construction is weak.

Thanks for that jackass. good thing we have people like you to rudely assist us novices!

 
forexman05 wrote >>

Thanks for that jackass. good thing we have people like you to rudely assist us novices!

Post the entire program. I will take a look at it.

 
wadem000 wrote >>

Post the entire program. I will take a look at it.

Wadem000.....thanks for the offer but this Ea has been makin me mad bank.....rather not post the whole thing up. Basically, I am trying to consolidate my strategy into one EA rather than two (which is how I am running things now quite effectively) .... this would allow me to put other EA's on for other strategies I am running manually.....Dan

apparently Roger would rather insult me than just help....I KNOW my construction is weak....that is why I am posting things on here! :) Happy pippin

 
forexman05 wrote >>

Wadem000.....thanks for the offer but this Ea has been makin me mad bank.....rather not post the whole thing up. Basically, I am trying to consolidate my strategy into one EA rather than two (which is how I am running things now quite effectively) .... this would allow me to put other EA's on for other strategies I am running manually.....Dan

apparently Roger would rather insult me than just help....I KNOW my construction is weak....that is why I am posting things on here! :) Happy pippin

Still offering to help if I can.

Since you do not want to post the entire app, extract the portion that is not working (complete with variable definitions).

Make a copy and prune the EA down to the variable definitions and the function that is not working. Test the pruned version. If it is still not working, post that pruned version only.

You will get more assistance that way; if we can see the "entire" program instead of just seeing an extract of what is not working. The problems are big and a waste of time. Take advantage of the forum while protecting your ideas

Consider pruning your code and posting it here to get help.

 
If I offended you, I'm sorry, but English isn't my native language and I couldn't explane you all nuances of code without this code. I didn't try to insult you.
Reason: