If_Then_order

Custom MT4 expert advisors published here.

Moderator: admin

If_Then_order

Postby Apprentice » Thu Feb 07, 2019 5:11 pm

Based on request.
viewtopic.php?f=27&t=67324
If Then Order Statement.png


If_Then_order.mq4
(16.76 KiB) Downloaded 181 times
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: If_Then_order

Postby Fx4mt.com » Fri Feb 08, 2019 8:55 pm

Thank you! Can you elaborate on the Magic Number?

Much appreciated! Very excited to try this out. Very grateful.
Fx4mt.com
 
Posts: 36
Joined: Tue Jan 15, 2013 1:19 pm

Re: If_Then_order

Postby Apprentice » Sat Feb 09, 2019 4:43 am

https://docs.mql4.com/trading/ordersend
Order magic number. May be used as user defined identifier.

The unique ID can come in handy if you have a more then one active strategy.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: If_Then_order

Postby rudyyy » Sun Feb 10, 2019 6:06 am

oh. my. gosh.

I've been wanting something like this for months and I just happen to stumble upon this site THREE DAYS after you post this?!?!

THANK YOU!
rudyyy
 
Posts: 2
Joined: Sun Feb 10, 2019 6:04 am

Re: If_Then_order

Postby rudyyy » Tue Feb 12, 2019 5:55 am

Hi Apprentice,

I was testing this out today and noticed a few times that a trade would not trigger. Is there a min distance that a price trigger needs to be from current price when the EA is activated? Obviously outside the spread, but even a few pips away it was still giving me issues. Im not sure what caused certain orders to activate and others not.

Any feedback or tips would be appreciated
rudyyy
 
Posts: 2
Joined: Sun Feb 10, 2019 6:04 am

Re: If_Then_order

Postby Apprentice » Thu Feb 14, 2019 6:06 am

Can you provide a trading log? EA will print the reason why the order was not created.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 22093
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: If_Then_order

Postby Fx4mt.com » Mon Feb 18, 2019 5:55 pm

Hi Apprentice, he and I have been emailing back and forth a bit and I can't speak for him, but it appears as though all orders are executing properly on my end.

Quick question, on the stop loss and limit inputs, if these were left to 0 would that mean that no stop loss or limit would be entered?
Fx4mt.com
 
Posts: 36
Joined: Tue Jan 15, 2013 1:19 pm


Return to MT4 Expert Advisors

Who is online

Users browsing this forum: No registered users and 10 guests