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
Wow .. what you want is basically pretty easy to code.
Can you guide me to it? I already have this from web
Now, I have made it very clear that I am no coder, but I think I need some line below "int start()" which counts number of EXECUTED [non pending] orders and then goes on to next code only if they are 2 and executes the rest of code.. if (AccountProfit()>= My_Money_Profit_Target).. etc
right? How to say such line in MQL ?
Yes deVries,
everything fails and I shouldn't do that if you say so, but since I really don't see much help in you answer .....
You do understand that the code isn't a commercial EA intended for sale to a fussy customer, right We are trying to work something out and if you don't want to help, you should at least leave it alone.
You really reckon that if I change the time frame several times..... what? The Slippage will be 3000000 ? Not in my MT4 apparently. And if you don't believe me, run a test yourself.
My test says that when you change the time frames, the EA goes trough deinit/init cycle and since the code mentioned is in the OnInit, Slippage will be right at 30 point every time.
As anyone can see, changing time frames will not bring the Slippage to a million, if that's what you're suggesting.
And no, it isn't a fake picture, it's real, you can check the time of changing each time frame.
Hope it helps.
this fails .....
for lot of trades prc is not the right price
what do you have to say about that...
read Double Calls to OnInit() and OnDeinit()
there are problems with new versions
(The double OnInit() issue appears to be fixed in build 628 but have still not this version )
this fails .....
for lot of trades prc is not the right price
what do you have to say about that...
hehehe, now you two have gone deep into the rabbit hole and are discussing something which is making birds fly over my head ! xD .. could you please look at that lame code line that I added? =D
hehehe, now you two have gone deep into the rabbit hole and are discussing something which is making birds fly over my head ! xD .. could you please look at that lame code line that I added? =D
Correct Ask and Bid are the prices of chartSymbol if the trade is other Symbol closingprice is wrong
what effect will this have ??
is it failing??? OrderType is pending trade ???
or is it closing fails
that case you need to get last error GetLastError() knowing the reason
EA starts ---> Does nothing till there is 0 or 1 order ----> Makes a 'call open sound' when 2nd order gets triggered ----> Closes both orders at X amount of pure profit [after considering spread] and makes a 'call close sound' ]
of course, call open and call close sound files can be any small wave files.. easily available on mt4 itself. .. I think these things can be achieved in the above EA that I had posted by changing a few things ! hehehe help me plz =D
Hi tatyawinchu,
I believe you didn't understand well what the EA posted does. Let me walk you trough step by step and you decide if it is something you can or cannot use for your purpose.
The stop loss based on account is there to protect anyone who wants to use it and I would never recommend to be in the market without at least an emergency stop, if you have 10 000 in your account and you want to risk it all, just set the StopLossLimit to 10 000.
Your decision.
Now, back to the code, it's as easy as 1, 2, 3 :
1. If you read the code in the OnTick function - that is the part that gets executed on every tick - you will see the first thing it does is : CountMyOrders. Hope you see that. Next, if myOrders <1 means there are no orders yet, checks the account equity, remembers it and that it.
Does nothing else. Next tick, if still no orders, back to waiting. Pretty boring to be an EA, ins't it ?
2.When an order is placed myOrders<1 isn't true any more so at the next tick, it will jump over to the next line and calculate the profit for the order or orders that are in the market.
3.Next, it will compare the sum of all orders profit with the target profit.
Easy, isn't it. If the profit reaches the target, next line says : ExitAll . And will pop up an alert (with sound) on the screen telling you that orders have reached their target !
Wasn't so bad, was it ?
And I forgot to mention, if the market goes against you and the loss of equity reaches the preset level, it will take you out of the market to protect whatever capital is left.
And that's the best help I could give you.
If you need more than that, it's probably a job for the guys who do more custom code than this.
Hope it helps.
Cheers
Hi tatyawinchu,
I believe you didn't understand well what the EA posted does. Let me walk you trough step by step and you decide if it is something you can or cannot use for your purpose.
The stop loss based on account is there to protect anyone who wants to use it and I would never recommend to be in the market without at least an emergency stop, if you have 10 000 in your account and you want to risk it all, just set the StopLossLimit to 10 000.
Your decision.
Now, back to the code, it's as easy as 1, 2, 3 :
1. If you read the code in the OnTick function - that is the part that gets executed on every tick - you will see the first thing it does is : CountMyOrders. Hope you see that. Next, if myOrders <1 means there are no orders yet, checks the account equity, remembers it and that it.
Does nothing else. Next tick, if still no orders, back to waiting. Pretty boring to be an EA, ins't it ?
2.When an order is placed myOrders<1 isn't true any more so at the next tick, it will jump over to the next line and calculate the profit for the order or orders that are in the market.
3.Next, it will compare the sum of all orders profit with the target profit.
Easy, isn't it. If the profit reaches the target, next line says : ExitAll . And will pop up an alert (with sound) on the screen telling you that orders have reached their target !
Wasn't so bad, was it ?
And I forgot to mention, if the market goes against you and the loss of equity reaches the preset level, it will take you out of the market to protect whatever capital is left.
And that's the best help I could give you.
If you need more than that, it's probably a job for the guys who do more custom code than this.
Hope it helps.
Cheers
Hmm.. looks like we are drifting apart ..
My exact requirement is as follows:-
Step1 EA starts .
Step 2 EA checks for current account profit so that it knows the start point to calculate from.
Step 3 EA checks for running open orders [not pending].
Step 4 EA does nothing if there is no running order OR there is just ONE running order.
Step 5 EA makes a sound when SECOND order gets triggered .. This second order will be on some other pair.
Step 6 EA closes BOTH the orders at X profit after taking into consideration the SPREAD and make a sound.... here BOTH should be ALL open orders .. does not need to delete pending orders
What the EA does not need .. SL or TP setting of any kind..
Preferably, EA should work on orders more than two, but not needed if its too difficult..
[ Though logically I feel it wont be difficult, rather very easy, because EA activates to close ALL open orders if they are MORE THAN 1 .. thats 2 or MORE automatically! so that may be already covered by EA.. correct me if wrong!]
Wow .. what you want is basically pretty easy to code.
You're funny. Subtle but funny.
You're funny. Subtle but funny.
what if I can add an IF loop and then paste the rest of the code below which starts the loop?
The IF condition should check the OrdersTotal to be => 2 so that control is passed to close all open orders at X profit after spread?
How to tell EA to do noting in certain case?
Say I do the following
Ok, cant seem to get out of this box yet ! hehe need to know forum stuff more ! but, as you can see above, if that "if (OrdersTotal()=>2)" is valid, it would directly solve my problems .. because the rest of the stuff would be executed only if the total running market orders are 2 ! =D .. and some forum guru please release this text from this src prison box ! ;)