Consider commission

Locked
shoshanna

Consider commission

Post by shoshanna »

Hi there.

I am using an EA and it closes some orders prematurely. Sometimes it is just over a dollar, making the trade a win, but with commission a loss. Please I am begging, can someone help add a considercommission function?
phil_trade

Re: Consider commission

Post by phil_trade »

shoshanna wrote:
Shoshanna.mq4
Hi there.

I am using an EA and it closes some orders prematurely. Sometimes it is just over a dollar, making the trade a win, but with commission a loss. Please I am begging, can someone help add a considercommission function?
Hi

you are using OrderProfit() to detect profit. But MQL help say for Orderprofit() :

Returns the net profit value (without swaps or commissions) for the selected order. For open positions, it is the current unrealized profit. For closed orders, it is the fixed profit.
Returns profit for the currently selected order.


So you have to calculate Net Profit with OrderProfit()+Orderswap()+OrderCommission()

Philippe
shoshanna

Re: Consider commission

Post by shoshanna »

Thank you for the reply Philippe.

I don't know the first thing about programming so I am clueless what to do next.

Can you please help?
phil_trade

Re: Consider commission

Post by phil_trade »

shoshanna wrote:Thank you for the reply Philippe.

I don't know the first thing about programming so I am clueless what to do next.

Can you please help?
sorry but no time to do this. So you have to find a MQL programmer to do this for you.
shoshanna

Re: Consider commission

Post by shoshanna »

Thank you. ☺
dietcoke
Trader
Posts: 162
Joined: Tue Nov 15, 2011 9:59 pm

Re: Consider commission

Post by dietcoke »

phil_trade wrote:
shoshanna wrote:Thank you for the reply Philippe.

I don't know the first thing about programming so I am clueless what to do next.

Can you please help?
sorry but no time to do this. So you have to find a MQL programmer to do this for you.

I won't touch decompiled code personally but as phillipe says, you could try replacing all instances of

Code: Select all

OrderProfit()
with

Code: Select all

(OrderProfit()+OrderSwap()+OrderCommission())
and then see if your EA will compile
Image
shoshanna

Re: Consider commission

Post by shoshanna »

Thank you very much dietcoke.
I don't even know what compiled/decompiled means. Am I understanding correctly : I have to load this in Metaeditor, press ctrl-f, find all instances of Orderprofit and replace them with Orderprofit+orderswap+ordercommission ?(with the brackets of course - will copy and paste from here) and then press F5 to see if it compiles?
User avatar
SteveHopwood
Owner
Posts: 9904
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

Re: Consider commission

Post by SteveHopwood »

shoshanna wrote:Thank you very much dietcoke.
I don't even know what compiled/decompiled means. Am I understanding correctly : I have to load this in Metaeditor, press ctrl-f, find all instances of Orderprofit and replace them with Orderprofit+orderswap+ordercommission ?(with the brackets of course - will copy and paste from here) and then press F5 to see if it compiles?
So, you say you understand nothing of all this, then show that you actually understand everything that is going on.

After offering up decompiled code in a public forum whose owner has a track record of banning members stupid enough to flout copyright.

Wow. This is a rare form of idiocy. Congratulations on reaching a new low level of stupidity.

This thread disappears in 24 hours come what may. You have the intervening period to convince me not to delete your membership here. The clock is ticking and I do not mess around when acting to preserve the future of my forum.

In the meantime, this thread is locked. I have deleted the file from your post 1 in case it breeches copyright.
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. pianodoodler@hotmail.com is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
Locked

Return to “Coders Hangout”