Could you please solve one mystery: Why when I inserted this function || isCloseLastPosByTake() == True || the expert in the tester started to slow down very much, times 10! This is one of the 4 mutually exclusive conditions, so I can't use the if chain as in summed conditions to make the code run faster. What can you advise me? Thank you in advance for your advice!
That function goes through the orders to find the last close at the take value. Rework this function to speed it up. They are all universal in Kim's case, which means that you can get rid of a lot of unnecessary things from there. Again, everything depends on the logic of your Expert Advisor.
Can you please tell me how to open a buy order? Sellorder conditionsif(OrdersTotal()==0&& ma0<ma1 && ma1<ma2).I understand that we should usea switch.What should I write instead of(x,a,b)?
artmedia70: That function goes through the orders to find the last one closed at the take. Rework this function to speed it up. They are all universal in Kim's program, which means that a lot of unnecessary things can be removed from them. Again, everything depends on the logic of your Expert Advisor.
Thank you very much! I was thinking that I could use some operator, but they don't go through cases with "or" for one and the same action.
Can you tell me how to open a buy order? Sell order conditionsif(OrdersTotal()==0&& ma0<ma1 && ma1<ma2).I understand that we should usea switch.What should I write instead of(x,a,b)?
I have been struggling all day to understand why the function returns -1
int typ(string t, int m)
{ datetime z=0 ; int p=-1,i;
int d=OrdersHistoryTotal();
if ( t=="0") t=Symbol();
for( i=0;i<=d;i++){
if ( OrderSelect(i,SELECT_BY_POS,MODE_HISTORY) ) {
if ( (OrderSymbol() == t || t=="0" ) && ( OrderMagicNumber() == m || m==-1 ) ){
if ( OrderCloseTime()>z&&OrderType()<=1)
{
z =OrderCloseTime();
p =OrderType();
}}}}
return(p);
}
If there is no such a symbol if ( t=="0") t=Symbol(); then make t equal to our symbol to which the EA is attached ;
I'm sorry, I didn't notice... Then here it is:
for( i=0;i<d; i++){
The last order number is OrdersTotal()-1; But that's not the point. I tried it, it turns out the history of closed orders is not visible in the tester, on the demo account your code works.
Could you please solve one mystery: Why when I inserted this function || isCloseLastPosByTake() == True || the expert in the tester started to slow down very much, times 10! This is one of the 4 mutually exclusive conditions, so I can't use the if chain as in summed conditions to make the code run faster. What can you advise me? Thank you in advance for your advice!
Can you please tell me how to open a buy order? Sell order conditionsif(OrdersTotal()==0&& ma0<ma1 && ma1<ma2). I understand that we should usea switch. What should I write instead of(x,a,b)?
if(OrdersTotal()==0)
switch(x)case'a':case'b':
Thank you in advance!
That function goes through the orders to find the last one closed at the take. Rework this function to speed it up. They are all universal in Kim's program, which means that a lot of unnecessary things can be removed from them. Again, everything depends on the logic of your Expert Advisor.
Can you tell me how to open a buy order? Sell order conditionsif(OrdersTotal()==0&& ma0<ma1 && ma1<ma2). I understand that we should usea switch. What should I write instead of(x,a,b)?
if(OrdersTotal()==0)
switch(x)case'a':case'b':
Thank you in advance!
Only one order will open, no more than that, either to sell or to buy.
I have been struggling all day to understand why the function returns -1
The call goes like this
All orders are in the history !
What can be the error?
I have been struggling all day to understand why the function returns -1
The call goes like this
All orders are in the history !
What can be the error?
There is no "0", there is "EURUSD", "AUDUSD" etc.
There is no such symbol "0", there is "EURUSD", "AUDUSD" etc.
If there is no such symbol if ( t=="0") t=Symbol(); then make t equal to our symbol to which the EA is attached;
If there is no such a symbol if ( t=="0") t=Symbol(); then make t equal to our symbol to which the EA is attached ;
I'm sorry, I didn't notice... Then here it is:
The last order number is OrdersTotal()-1; But that's not the point. I tried it, it turns out the history of closed orders is not visible in the tester, on the demo account your code works.
I don't have what you wrote in my code.
I do.
int d=OrdersHistoryTotal();and it goes through first...
Well, it doesn't matter, I found the problem elsewhere in the code ....