Edit Your Comment
Orders per symbol.
Sep 11, 2013 at 14:02
Membre depuis Jul 17, 2012
posts 275
it is not a weird ea. just a logic that needs to be implemented.
to limit orders, the ea just needs to have checks for any open orders and have it not to open more than required. 😄
for per symbol is easy, you just need to add symbol checks only to the logic. 😎
the above logic also can be implemented for buy limit or sell limit too. 😎
to limit orders, the ea just needs to have checks for any open orders and have it not to open more than required. 😄
for per symbol is easy, you just need to add symbol checks only to the logic. 😎
the above logic also can be implemented for buy limit or sell limit too. 😎
Past experience usually helps present self
Membre depuis Nov 21, 2011
posts 1718
Sep 11, 2013 at 14:03
Membre depuis Nov 21, 2011
posts 1718
Hi
If you know how to code, you simply need to count numbers of current trades (opened one) and then create a parameter that will limit to the specific number you mention.
So the EA can't open any more orders untill one of them has been closed.
Cheers
If you know how to code, you simply need to count numbers of current trades (opened one) and then create a parameter that will limit to the specific number you mention.
So the EA can't open any more orders untill one of them has been closed.
Cheers
Sep 11, 2013 at 14:15
Membre depuis May 11, 2011
posts 235
Can do something like this: (It's a rough example, not a complete EA!!!)
extern string SymbolA = 'EURUSD';
extern int OrderCountLimit = 10;
int AllOrderCount;
void OrderCount()
{
AllOrderCount = 0;
for(int i=0;i<OrdersTotal(); i++ )
{
if(OrderSelect(i, SELECT_BY_POS)==true && OrderSymbol() == SymbolA) //or Symbol() for current chart.
{
AllOrderCount++;
}
}
}
// Other code that eventually calls CheckOrderCount()
void CheckOrderCount()
{
if (AllOrderCount < OrderCountLimit)
{
OpenOrder();
}
}
void OpenOrder()
{
//Code to open / create order
}
extern string SymbolA = 'EURUSD';
extern int OrderCountLimit = 10;
int AllOrderCount;
void OrderCount()
{
AllOrderCount = 0;
for(int i=0;i<OrdersTotal(); i++ )
{
if(OrderSelect(i, SELECT_BY_POS)==true && OrderSymbol() == SymbolA) //or Symbol() for current chart.
{
AllOrderCount++;
}
}
}
// Other code that eventually calls CheckOrderCount()
void CheckOrderCount()
{
if (AllOrderCount < OrderCountLimit)
{
OpenOrder();
}
}
void OpenOrder()
{
//Code to open / create order
}
For every loss there should be at least an equal and opposite profit.
Membre depuis Nov 21, 2011
posts 1718
Sep 11, 2013 at 14:20
Membre depuis Nov 21, 2011
posts 1718
Yes... It seems you know how to count : )
If not working let me know...
If not working let me know...
forex_trader_139412
Membre depuis Jul 16, 2013
posts 385
Sep 11, 2013 at 20:11
Membre depuis Jul 16, 2013
posts 385
Thanks for your replies. I appreciate that you took the time to respond. I have no coding experience.(making this very hard) I googled this, there are quite a few codes, but no EA. All the people that had this in mind seemingly could code, made the EAs and never shared anything on the internet, I can't even get email addresses to get hold of anybody that coded such thing.
I read online (amongst the codes for this on the internet) that it would have to check the account history if there has been a trade for this symbol before placing any more. I went for asking whether there is an EA that could do this. (figured it will be much easier than getting a coder to check the EA) Will another EA be easier, or modifying the existing EA to do this?
Regards
Ryan
I read online (amongst the codes for this on the internet) that it would have to check the account history if there has been a trade for this symbol before placing any more. I went for asking whether there is an EA that could do this. (figured it will be much easier than getting a coder to check the EA) Will another EA be easier, or modifying the existing EA to do this?
Regards
Ryan
Membre depuis Nov 21, 2011
posts 1718
Sep 11, 2013 at 20:18
Membre depuis Nov 21, 2011
posts 1718
I thought you knew how to code... in fact you just copy paste what you found.
I don't know what you really need so I can't give a code.
What do you need? Implement this logic into another EA?
I don't know what you really need so I can't give a code.
What do you need? Implement this logic into another EA?
Sep 11, 2013 at 23:11
(édité Sep 11, 2013 at 23:13)
Membre depuis Jul 17, 2012
posts 275
@CrazyTrader
I knew @RSTrading cant code. That is why I replied like that for the first reply. 😎
---
Getting a free EA will not do any good here @RSTrading . I already knew that type of ea and of course it needs a little bit of coding to get what you want to work. 😝
Or just get @CrazyTrader or @xgavinc to code for you for a fee. 😄
I knew @RSTrading cant code. That is why I replied like that for the first reply. 😎
---
Getting a free EA will not do any good here @RSTrading . I already knew that type of ea and of course it needs a little bit of coding to get what you want to work. 😝
Or just get @CrazyTrader or @xgavinc to code for you for a fee. 😄
Past experience usually helps present self
forex_trader_139412
Membre depuis Jul 16, 2013
posts 385
Sep 12, 2013 at 08:33
Membre depuis Jul 16, 2013
posts 385
@deysmacro , I am not looking for a free EA here, just want to know if there is such a thing so I don't have to bother coders with it.
@CrazyTrader I was purely looking for another EA because I didn't want to bother coders with modifying the existing EA, though I think it will be way easier if the actual EA is just modified. So basically then I need to implement this logic into my EA. Can you or xgavinc help please?
@CrazyTrader I was purely looking for another EA because I didn't want to bother coders with modifying the existing EA, though I think it will be way easier if the actual EA is just modified. So basically then I need to implement this logic into my EA. Can you or xgavinc help please?
forex_trader_139412
Membre depuis Jul 16, 2013
posts 385
Sep 12, 2013 at 08:34
Membre depuis Jul 16, 2013
posts 385
@CrazyTrader - Do I need to paste it at a specific place, or can I just paste anywhere?
Membre depuis Nov 21, 2011
posts 1718
Sep 12, 2013 at 08:52
Membre depuis Nov 21, 2011
posts 1718
I count like this:
/*
Count Open trades
*/
int countTrades(){
int trades = 0;
for(int cnt = OrdersTotal()-1; cnt >= 0; cnt--){
if(!OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) {
logData('countTradesTP : Error : '+GetLastError());
}
if(OrderSymbol() == Symbol() && OrderMagicNumber() == magicalNumber && (OrderType() == OP_BUY || OrderType() == OP_SELL)) {
trades++;
}
}
return(trades);
}
// So now you owe me 50 pips : )
/*
Count Open trades
*/
int countTrades(){
int trades = 0;
for(int cnt = OrdersTotal()-1; cnt >= 0; cnt--){
if(!OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)) {
logData('countTradesTP : Error : '+GetLastError());
}
if(OrderSymbol() == Symbol() && OrderMagicNumber() == magicalNumber && (OrderType() == OP_BUY || OrderType() == OP_SELL)) {
trades++;
}
}
return(trades);
}
// So now you owe me 50 pips : )
forex_trader_139412
Membre depuis Jul 16, 2013
posts 385
Sep 12, 2013 at 11:06
Membre depuis Jul 16, 2013
posts 385
Thanks Crazytrader.
Looking back at your first post, it seems that you are under the impression that it shouldn't open more trades when there is an open trade. It can do this, the main thing I am looking for is it must only open one trade per currency pair per day. At the moment it opens up to three trades for the currency pair per day.
Thinking about it now, it should be allowed one buy and one sell for each currency pair per day. At the moment it opens three buy trades. (Sorry, just thought about this now) Does it matter where the code is pasted or can I just paste it anywhere?
Looking back at your first post, it seems that you are under the impression that it shouldn't open more trades when there is an open trade. It can do this, the main thing I am looking for is it must only open one trade per currency pair per day. At the moment it opens up to three trades for the currency pair per day.
Thinking about it now, it should be allowed one buy and one sell for each currency pair per day. At the moment it opens three buy trades. (Sorry, just thought about this now) Does it matter where the code is pasted or can I just paste it anywhere?
Sep 12, 2013 at 11:12
Membre depuis Jul 17, 2012
posts 275
The current code is no longer valid since it does not fulfills the requirement. So, again, @CrazyTrader have to alter the coding, and you will be owing him 100pips. 😄
Past experience usually helps present self
Membre depuis Nov 21, 2011
posts 1718
Sep 12, 2013 at 13:09
Membre depuis Nov 21, 2011
posts 1718
Yes I was sure... That's why there is no point to give code like that. You can't copy paste it anywhere just like that.
Then You have to call the fucntion into your logic code to check if EA is allowed to place the trade depending on your parameter.
Also.. I said that I can't understand your logic... because you resume it in one sentence. And like me, once you start modifying codes, you better learn it because you will always have something to add.
So if you are quiet young, it's still time to learn... You need to know so basics, so at least when you have an help like that, you know how to implement it.
See, we are talking and now, we discover that you need restriction. (Only one type trade per day) which different and needs more code.
Tomorrow, what you will ask? : )
Then You have to call the fucntion into your logic code to check if EA is allowed to place the trade depending on your parameter.
Also.. I said that I can't understand your logic... because you resume it in one sentence. And like me, once you start modifying codes, you better learn it because you will always have something to add.
So if you are quiet young, it's still time to learn... You need to know so basics, so at least when you have an help like that, you know how to implement it.
See, we are talking and now, we discover that you need restriction. (Only one type trade per day) which different and needs more code.
Tomorrow, what you will ask? : )
Membre depuis Nov 21, 2011
posts 1718
Sep 12, 2013 at 13:14
Membre depuis Nov 21, 2011
posts 1718
See this EA, started Monday that I've been working over weeks... I'm still not happy with it so I added some new filters almost everyday.
https://www.myfxbook.com/members/CrazyTrader/scalping-fx-into-momentum/688290
https://www.myfxbook.com/members/CrazyTrader/scalping-fx-into-momentum/688290
Sep 12, 2013 at 13:34
Membre depuis Jul 17, 2012
posts 275
CrazyTrader posted:
Tomorrow, what you will ask? : )
Actually the first question asked from @RSTrading lacks many crucial requirements. That is why I am not seriously considering the codes since @RSTrading will ask for more.
And it happen just like what I have expected. 😎
Past experience usually helps present self
Membre depuis Nov 21, 2011
posts 1718
Sep 12, 2013 at 13:42
Membre depuis Nov 21, 2011
posts 1718
So here, you have 2 examples that it is possible as I don't have neither programming background except from Excell lol.
If ('I could create EA'; Then I might make pips)
How I did... I firstly paid for my EAs from a programmer.... Then I look at his coding and learn from it. I started by changing little things... and then it comes with time if your are motivated.
Or You can buy a dedicated book on MQL4... good luck.
So you can contact me if you want.
Cheers
If ('I could create EA'; Then I might make pips)
How I did... I firstly paid for my EAs from a programmer.... Then I look at his coding and learn from it. I started by changing little things... and then it comes with time if your are motivated.
Or You can buy a dedicated book on MQL4... good luck.
So you can contact me if you want.
Cheers
*Lutilisation commerciale et le spam ne seront pas tolérés et peuvent entraîner la fermeture du compte.
Conseil : Poster une image/une url YouTube sera automatiquement intégrée dans votre message!
Conseil : Tapez le signe @ pour compléter automatiquement un nom dutilisateur participant à cette discussion.