Download MetaTrader 5
To add comments, please log in or register
Have you developed a profitable strategy? Share it with millions of traders via Signals!
Joa
29
Joa 2014.02.26 13:11 

Here is my little problem

I want to make it clear that I am NOT versed in programming. I am way too old for such things.

I am an active trader using EA's and all I've done is written instructions. That I can do, so much learning was easy.

The Problem:

All of my EA's execute ONE trade per candle. That is not ideal these days. I would want my EA to execute on every tick AND take every tick available on that particular signal.

The way the EA's are written it won't do it on tick, on EACH AND EVERY tick. I do not want to run "offline" charts, I have no intention to gather ticks. I do not want to create charts on tick.

All I want is the EA to recognize the signal that arrived and then execute series of positions, it does not matter whether it is 10 or 500 in that particular 1M candle, or a 15M candle, I just want on every tick a position.

What is it that I need to change?


Again, I am not a programmer. The EA's work fine as is and I got all features in there that I could dream up. Please nobody lecture me on the risks involved. I am old enough to know and I got plenty and enough cash in the account for any stupid idea of mine. .... and it's my own money. :) I don't need to "back test" either. I know how the EA works and I know what the indicators are doing.

It really comes down to me not understanding why the EA can't be changed to executing SERIES of positions and everybody wants to tell me to use offline charts.

I would greatly appreciate ANY help. thanks

Ovo Cz
3049
Ovo Cz 2014.02.26 13:19  
JoaTrader:

Here is my little problem

I want to make it clear that I am NOT versed in programming. I am way too old for such things.

I am an active trader using EA's and all I've done is written instructions. That I can do, so much learning was easy.

The Problem:

All of my EA's execute ONE trade per candle. That is not ideal these days. I would want my EA to execute on every tick AND take every tick available on that particular signal.

The way the EA's are written it won't do it on tick, on EACH AND EVERY tick. I do not want to run "offline" charts, I have no intention to gather ticks. I do not want to create charts on tick.

All I want is the EA to recognize the signal that arrived and then execute series of positions, it does not matter whether it is 10 or 500 in that particular 1M candle, or a 15M candle, I just want on every tick a position.

What is it that I need to change?


Again, I am not a programmer. The EA's work fine as is and I got all features in there that I could dream up. Please nobody lecture me on the risks involved. I am old enough to know and I got plenty and enough cash in the account for any stupid idea of mine. .... and it's my own money. :) I don't need to "back test" either. I know how the EA works and I know what the indicators are doing.

It really comes down to me not understanding why the EA can't be changed to executing SERIES of positions and everybody wants to tell me to use offline charts.

I would greatly appreciate ANY help. thanks




Perhaps I missed it, could you specify more exactly, what your question was? Otherwise it looks like a generic debate.
Joa
29
Joa 2014.02.26 13:26  
Ovo:

Perhaps I missed it, could you specify more exactly, what is your question? Otherwise it looks like a generic debate.

I try:


Here is what I believe is relating to the execution of orders:

int CalculatePositionBuy()
{
int Pos;
int orderT = OrdersTotal();
if(orderT > 0)
{
for(int i = orderT - 1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;
if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumberLong)
{
if(OrderType() == OP_BUY) Pos++;
}
}
return(Pos);
}
else if(orderT == 0) return(0);
}

//+------------------------------------------------------------------+

When running the EA - it makes ONE position per bar. On each bar, I get hundreds of signals. Say.. my Indicators say LONG. During this particular time frame, be that 1M or 15 M, for as long as this instruction to buy is TRUE, I want execution on EVERY signal that arrives and is available to me. If the market shoots up by 100 pips, I want on every quote a position... taking every darn quote to open a position.....

How else am I going to explain since I am not a programmer and I do not understand code. My talent is limited to writing instructions to execute based on indicator signals................

Keith Watford
Moderator
9543
Keith Watford 2014.02.26 13:32  
JoaTrader:

I try:


Here is what I believe is relating to the execution of orders:

int CalculatePositionBuy()
{
int Pos;
int orderT = OrdersTotal();
if(orderT > 0)
{
for(int i = orderT - 1; i >= 0; i--)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;
if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumberLong)
{
if(OrderType() == OP_BUY) Pos++;
}
}
return(Pos);
}
else if(orderT == 0) return(0);
}

//+------------------------------------------------------------------+

When running the EA - it makes ONE position per bar. On each bar, I get hundreds of signals. Say.. my Indicators say LONG. During this particular time frame, be that 1M or 15 M, for as long as this instruction to buy is TRUE, I want execution on EVERY signal that arrives and is available to me. If the market shoots up by 100 pips, I want on every quote a position... taking every darn quote to open a position.....

How else am I going to explain since I am not a programmer and I do not understand code. My talent is limited to writing instructions to execute based on indicator signals................



The code that you show doesn't open any orders.
Joa
29
Joa 2014.02.26 13:35  
GumRai:

The code that you show doesn't open any orders.

As I said...... I wouldn't even know WHERE to look. Here is another that may help someone to help me:


int start()
{
int n, k;
int d = GetDigits();
int tot = OrdersTotal();
double profBest, profWorst, orderLots;
double SumProfBuy = 0;
double SumProfSel = 0;
int cB = CalculatePositionBuy();
bool oB, oS;
//---
if(cB > 0 && TrailingStop == true)
{
for(n = 0; n < tot ; n++)
{
OrderSelect(n, SELECT_BY_POS, MODE_TRADES);
if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumberLong)
{
if(Ask - OrderOpenPrice() > 0)
{
if(OrderStopLoss() < Bid - Point * TrailingStopShort * d)
{
OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStopShort * d, OrderTakeProfit(), 0, Green);
}
}
}

}


and then for long this is what I have BEFORE my self written instructions based on indicators:

if(OpenBuy == true)//_________________________________________________________________________________________________
{
int ticketB = 0;
bool ticCloseS;
int orderID;
cB = CalculatePositionBuy();
cS = CalculatePositionSel();
if(MaxAllowPos == true && cB >= 0 && cB < MaxAllowPosNum)


My instruction code lines are ok, they work as intended. There is NO problem there. All I want is this EA to take every signal and not limiting itself to ONE per candle........

Simon Gniadkowski
Moderator
17994
Simon Gniadkowski 2014.02.26 13:53  
JoaTrader:

As I said...... I wouldn't even know WHERE to look. Here is another that may help someone to help me:


<REMOVED>

Please use the SRC button to post code . . .
whroeder1
14236
whroeder1 2014.02.26 14:21  
JoaTrader:

All of my EA's execute ONE trade per candle. That is not ideal these days. I would want my EA to execute on every tick AND take every tick available on that particular signal.

The way the EA's are written it won't do it on tick, on EACH AND EVERY tick. I do not want to run "offline" charts, I have no intention to gather ticks. I do not want to create charts on tick.

  1. Use SRC
  2. EA's are written to do EVERY tick, they are called OnTick() (or the int start()) each tick. It is your EA that is filtering them out, but you haven't shown that code.
  3. If you start opening many orders, you will get a margin call very quickly. I suggest you don't open another order, until you have moved the SL to breakeven.
Joa
29
Joa 2014.02.26 14:31  
int start()
{
int n, k;
int d = GetDigits();
int tot = OrdersTotal();
double profBest, profWorst, orderLots;
double SumProfBuy = 0;
double SumProfSel = 0;
int cB = CalculatePositionBuy();
bool oB, oS;
//---
if(cB > 0 && TrailingStop == true)
{
for(n = 0; n < tot ; n++)
{
OrderSelect(n, SELECT_BY_POS, MODE_TRADES);
if(OrderType() == OP_BUY && OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumberLong)
{
if(Ask - OrderOpenPrice() > 0)
{
if(OrderStopLoss() < Bid - Point * TrailingStopShort * d)
{
OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStopShort * d, OrderTakeProfit(), 0, Green);
}
}
}

}

and then for long this is what I have BEFORE my self written instructions based on indicators:
if(OpenBuy == true)//_________________________________________________________________________________________________
{
int ticketB = 0;
bool ticCloseS;
int orderID;
cB = CalculatePositionBuy();
cS = CalculatePositionSel();
if(MaxAllowPos == true && cB >= 0 && cB < MaxAllowPosNum)
Joa
29
Joa 2014.02.26 14:33  

I wouldn't know WHERE in the EA there would be a filter.......

This appears to me as if it was everything relating to execution of orders. The rest follows below AFTER a position has been entered and relates in my opinion to closing of positions only

You commented that they are written to execute on every tick....... just what I wanted all along...


I wonder WHERE in the EA there is a filter ...

Joa
29
Joa 2014.02.26 14:47  
WHRoeder:
  1. Use SRC
  2. EA's are written to do EVERY tick, they are called OnTick() (or the int start()) each tick. It is your EA that is filtering them out, but you haven't shown that code.
  3. If you start opening many orders, you will get a margin call very quickly. I suggest you don't open another order, until you have moved the SL to breakeven.

Rest assured: I know what I am doing and I won't get a margin call, ever.


You refer to OnTick ....

I posted what I saw or thought is relating to the issue. Do I have to replace int start() with OnTick()????????

Alain Verleyen
Moderator
30295
Alain Verleyen 2014.02.26 16:18  
JoaTrader:

Rest assured: I know what I am doing and I won't get a margin call, ever.


You refer to OnTick ....

I posted what I saw or thought is relating to the issue. Do I have to replace int start() with OnTick()????????


What you asked for is a trivial task for an experimented programmer, if you post all the code.

If you can't do it here publicly, I suggest you to use the Jobs section.

You don't have to replace start() by OnTick().

/ /12
To add comments, please log in or register