Hello,
I should start off and say I am new to mql4. I am attempting to make a simple grid trader to start off with. Piecing it together slowly.
I am currently struggling with getting my EA to trade both buy and sell orders. Currently it seems to only want to trade sell orders. I currently am using:
You need to read the documentation on the code you are using . . . it is clear you don't understand it, how do you expect to make progress without expanding your knowledge and understanding as you progress ?
You have this code . . .
//No Trade if(isbuy==0) { return(0); } //Buy if(isbuy==OP_BUY) { //checkprice();
OP_BUY is a standard constant, it has an equivalent value of 0, see here: OP_BUY
So you check for "No Trade" by checking is isbuy = OP_BUY , if it is you return from start, if it isn't you carry on and check if isbuy = OP_BUY ?? well it can't be because if it was you would have already returned using the code above . . .
Read the documentation about OrderSend() and its associated standard constants . . . understand it and make some notes on anything you need to remind yourself about in the future.
I told you it was something simple.
I am fully aware that OP_BUY is equivalent to 0. The problem is I have changed the way I check to see if it is a buy signal or not. I use to have the variable isbuy change value to 0(notrade), 1(buy), and 2(sell) in checktrade().
I guess I just forgot to change it.
Thank you for your help.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I should start off and say I am new to mql4. I am attempting to make a simple grid trader to start off with. Piecing it together slowly.
I am currently struggling with getting my EA to trade both buy and sell orders. Currently it seems to only want to trade sell orders. I currently am using:
To check if my trades are valid. I have attempted to use return(OP_BUY/OP_SELL); vs isbuy=OP_BUY/OP_SELL; with no success. Also, please ignore the unused indicators, I have just been playing with calling in indicators.
Find below my open trade logic.
It is probably only a basic problem, but it seems as though once it gets the signal to sell, it doesn't want to change back.
Thanks for all the help