Opinion - very successfull EA - $3000 account to $6300 in two weeks (could have been $9000) - page 5

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1 fast thing before i go to work, there are boolean variables which can be true or false. you dont have to use a string for that.
Hardly to believe that you are following the book
1 fast thing before i go to work, there are boolean variables which can be true or false. you dont have to use a string for that.
Hardly to believe that you are following the book
I am trying. I am learning to trade + program + MQL at the same time.
Do you learn to drive a car by reading the book alone ?
but thankyou
I am getting the error that OpenBuyOrder and OpenSellOrder function returns no result
what am I doing wrong ?
you are getting this error because the functions OpenBuyOrder() & OpenSellOrder() actually dont return a result.. you have defined them as void, meaning they do not return any argument, yet you are trying to return an integer (0).
here's the code with some comments:
based on your GetSignal function, it seems like you want to use OpenBuy/SellOrder() to just open an order, rather than actually return some argument .. I cleaned up your GetSignal() function a bit with some comments
you are getting this error because the functions OpenBuyOrder() & OpenSellOrder() actually dont return a result.. you have defined them as void, meaning they do not return any argument, yet you are trying to return an integer (0).
here's the code with some comments:
based on your GetSignal function, it seems like you want to use OpenBuy/SellOrder() to just open an order, rather than actually return some argument .. I cleaned up your GetSignal() function a bit with some comments
That explains tonnes, thankyou very much, I am trying it now
my own code is a bit messed up because I am basically copying from other EAs and trying to make it work.
no problem.. feel free to ask if you run into other issues
ive collected lots of examples of trailing stops, but I need one which starts to trail immediately through the -ve values to 0, and then stop like a break even.
so if the market entry price is taken and the stop loss is 100, id the price moves to +25, the trailing stop moves to -75, and then once the price reaches 100, the trailing stop stops at 0 and doesnt move any further.
could anyone help me with this ? I have spent all day trying to get it to work and I just cant.
I thought I had done it but I haven't, my trailing stop follows through 0.
Pseudo Code:
zzuegg:
if (Buyorder and stoploss < openrice) : we need to trail
wouldnt stop loss always be lower than openprice, and vice versa ?
I am intending eventually to use a MaxLoss function, so I wont put in a stop loss with the OrderSend.
if Op_Buy
if bid <= OpenOrderPrice()+(Trailing stop value) : trail -- once bid > TSV it shouldn't continue to move ?
and
if Op_Sell
if ask >= OpenOrderPrice()-(Trailing stop value): trail ?
Then at a value higher than Trailingstop, Breakeven can finish the job ?
zzuegg:
if (Buyorder and stoploss < openrice) : we need to trail
wouldnt stop loss always be lower than openprice, and vice versa ? No, only before breakeven
I don't think your code works, seems you try to do the opposite...
no, it is working perfectly. Let me check it is the same now as in that response.
it is as close as I can get to a compromise of closing the loss gap behind a moving trade, but still giving it space to breath. Before this, the trade had to reach 60 points before BE happened so there were a lot of max stopped out trades, which caused my drawdown to be high. hopefully this will alter that.