Custom EA needs help! newbie here.

 

First, i would want you to know about my programming back ground. I know a little C++ and Pascal, but my skills are like some what beginners stuff or first year stuff. And the language in MQ4 i can read and understand. but writing in MQ4 is hard.

I'm trying to write a EA with this rules:

Looking on daily chart (d1)

Buy/Sell on the beginning of the day (GMT 00)(or other time frame)

if previous day is a up bar (open > close) then buy

if previous day is a dow bar (open < close) then sell

if previous day is a level ( open = close) then look at the previous bar ( 2 days ago) and so on

but if there is a open position (buy or sell) we don't trade that day ( at GMT 00) we wait for the next day and look at if we have a open trade or not.

the SL is 20 and TP is 100 but we should be able to change this. (external)

I'll attach my EA, the problem i have with it is that it's only BUYING!!!!! and i'm kinda sure it's not check for (if open==close) and even if there isn't a open position it doesn't buy/sell.... becoz i think it's stuck on only buying.. and i have EYE BALLED some bars.. and it's reading it wrong.. like it should be selling (a previous down bar) and it could still BUY.!!

can someone please!! correct it .. or give me some idea on how to write it CORRECTLY?? please

Files:
my_1x5_ea.mq4  7 kb
 

OK i think i have fixed the problems =) thz

 

hello Fubifx,

Could you attach statement this EA please? now that the problems are fixed.

 

haha.. it's a stupid problem.. that have took me 2 days to figure out..

it shouldn't be high low... it should be OPEN and CLOSE .. since everyday have a high and low.. and the high is always higher than the low " " ... so .. it's always buying..

i'll attach my new code... and i think it's working the way i want it.. please take a look and give some ideas =)

Files:
my_1x5_ea.mq4  5 kb