I have tryed set the OrdersTotal();
Okay thnks =)
But how should i do to make it work?
Sorry for my stupid questions im not so good at this.
Hi Pontuso,
you may use ordercomment to identify whether is there already an open position for the current signal.
eg.
double marker = iLow(NULL,0,1); //identifying the current bar
string markerstr = DoubleToStr(marker,4); // to string
double pos_in_this_bar = 0;
for(int k=OrdersTotal();k>=0 ;k--)
{
OrderSelect(k,SELECT_BY_POS);
if (OrderComment() == markerstr) pos_in_this_bar= pos_in_this_bar+1;
}
if (....................... && pos_in_this_bar ==0) // just oopen the trade if there is not a position for the current signal
OrderSend(Symbol(),OP_SELL,Lots,Ask,30,0,0,markerstr,MAGICMA,0,Red); // use the identifier as comment
Hi Pontuso,
you may use ordercomment to identify whether is there already an open position for the current signal.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi there
Im not very good at coding
Im having problem with an EA
The problem is. It only opens one order at the time.
I have tryed set the OrdersTotal();
But if i set the orderstotal to 100 for example it opens like 5 orders at the same price. Thats not what iwant!
This is how i want it to work
For example:
If my EA take one position when stochastic reaches 20
I want it to take one more position when stochastic reaches 50
Can someone please help me with this coding problem.
I created the EA at http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/
Thanks/