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
How do I do that? I'm sorry I don't know coding but I am willing to Try anything at this point to get it to stop, If there is a way to Limit my orders and pending orders it might could work?
donstar19
It only can be done from within the EA (it must be implemented in the EA code)
donstar19 It only can be done from within the EA (it must be implemented in the EA code)
And that is why i want to Create the stop light iCustom indicator to add to my EA.
to only trade when that signal is green.
And that is why i want to Create the stop light iCustom indicator to add to my EA. to only trade when that signal is green.
donstar19
You can use a function similar to this to count currently opened orders
{
int openedOrders = 0;
openedBuys = 0;
openedSells = 0;
totalProfit = 0;
//
//
//
//
//
for(int i=0; i < OrdersTotal(); i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;
//
//
//
//
//
if(OrderSymbol() != s_symbol) continue;
if(NoHedge)
{
if(OrderType() == OP_BUY) openedBuys++;
if(OrderType() == OP_SELL) openedSells++;
}
if(OrderMagicNumber() != MagicNumber) continue;
//
//
//
//
//
if(OrderType() == OP_BUY || OrderType() == OP_SELL) { openedOrders++; if (!AllSymbolsForProfitAndLoss) totalProfit += (OrderProfit()+OrderSwap()); }
}
return(openedOrders);
}
And if the number of currently opened orders is > 0, than you should prevent openeing a new order. You also can add a count of other types or orders in this function. Using indicator will not work unless you pass magic number and other data specific to the EA so that the indicator "knows" what to look for (which would make the indicator depending on the EA and that is why it is more eficient to do it as a function from the EA)
donstar19
You can use a function similar to this to count currently opened orders
{
int openedOrders = 0;
openedBuys = 0;
openedSells = 0;
totalProfit = 0;
//
//
//
//
//
for(int i=0; i < OrdersTotal(); i++)
{
if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;
//
//
//
//
//
if(OrderSymbol() != s_symbol) continue;
if(NoHedge)
{
if(OrderType() == OP_BUY) openedBuys++;
if(OrderType() == OP_SELL) openedSells++;
}
if(OrderMagicNumber() != MagicNumber) continue;
//
//
//
//
//
if(OrderType() == OP_BUY || OrderType() == OP_SELL) { openedOrders++; if (!AllSymbolsForProfitAndLoss) totalProfit += (OrderProfit()+OrderSwap()); }
}
return(openedOrders);
}
Thanks but its Coding ...I'm just trying to learn this stuff, where should i place this in my EA? its not compiling when I paste it?
Thanks but its Coding ...I'm just trying to learn this stuff, where should i place this in my EA? its not compiling when I paste it?
donstar19
And how were you planing to use it if it was an indicator?
donstar19 It only can be done from within the EA (it must be implemented in the EA code)
Hi Mladen thanks for all your help i sent you a Private Message. I don't want to flood the forum with my explanation on what im trying to do. But the reason i am asking for the Indicator to be Coded is because the program that im using to create my EA is based on conditions of multiple Indicators signals.
please help me to fix this code ...
arrow no appear if attach to chart
whats wrong ??
and please add more arrow for stop
if(Laguerre>Lb) = stop BUY
if(Laguerre<Lm) = stop SELL
thanks
please help me to fix this code ...
arrow no appear if attach to chart
whats wrong ??
and please add more arrow for stop
if(Laguerre>Lb) = stop BUY
if(Laguerre<Lm) = stop SELL
rizkyd
Which Laguerre indicator exactly are you using for custom calls?
am looking for an indicator that draws/shows trend lines of 3 different time frames on 1 chart .
the trend lines should have different colours and be labelled for easy identification.
the time frames should be selectable
please help me to fix this code ...
arrow no appear if attach to chart
whats wrong ??
and please add more arrow for stop
if(Laguerre>Lb) = stop BUY
if(Laguerre<Lm) = stop SELL
Never mind the previous question
Here is a version that works