[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 768
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
I just need to call the function, that's all I need is one line "If there is more orders than one .... and that's all" - and you're offering me a whole function
Here is how I store my order data
It's a simple one, put it in the library.
The type of an order to be counted and its master is given as input, it returns the number of open or set orders.
You can use it in the following way
if ((FastEma - SmallEma) > Compartor*Point && ChPos(OP_BUY,1111) < OpenPosition)
It's not complicated put it in the library .
Input is the type of order to be counted and its master, it returns the number of open or set orders .
This can be used in the following way
if ((FastEma - SmallEma) > Compartor*Point && ChPos(OP_BUY,1111) < OpenPosition)
I have such a function and I don't need it, I just need
just one line "if there are more orders than one .... then" and that's it
my data for the same function you've shown is stored here
and here's what it looks like
I think I've got it.
static int aaa = OrdersHistoryTotal()+ OrdersTotal()
if (your condition && aaa < OrdersHistoryTotal()+ OrdersTotal() )
{
operators
aaa=OrdersHistoryTotal()+ OrdersTotal()
}
If so, it's still better to put it into a function with magicians in mind . Can you tell us what you are working on? Logic is a bit strange if I got it right, when one more order is opened, isn't it easier to open orders no larger than OpenPosition?
Your function returns the total number of open orders and placed pending orders. How many orders OP_BUY, if there is OP_BUYLIMIT OP_SELLLIMIT OP_SELL etc. it does not show.
I've got it figured out, now the problem with the if function is that I don't know what the problem is.
the point is that the first value is executed.
This one does not work if (HaveBuyLimitOrderEnd== true)
{ModifyBuyStopOrder(PRAskS); // Select
} }
in words, if there is an order HaveBuyLimitOrderEnd, modify it with a price change PRAskS
I can't figure out what's wrong. The value of HaveBuyLimitOrderEnd is taken from void Myorders() in the code above
the value if(bt==1&&bl==7) is main, so if it's true, use all of the following
most likely haveBuyLimitOrderEnd== true because i have set OrderLots()==3*Lot all work only it modifies orders with 0.3 lot
Notice what is highlighted in red . The type of trade orders is the same and the variables in the pipe are set different, this is how it should be .
Yes, it should be, because there are different opening functions and I do not make a request for OrderType () and requested the flag whether it is open, but the problem is most likely not in this function because the other requests also do not work this I first threw, AND ON THE SAME FUNCTION OPEN NORMALLY
SO THE PROBLEM IS WITH THE REQUEST IN THE OPERATOR
The problem seems to be elsewhere. But you should probably see the code.
The problem seems to be elsewhere. But I think I need to see the code.
It's definitely not elsewhere, everything else works, the problem is that the request (HaveBuyLimitOrderEnd== true) is wrong, so I'm wondering how else to tell it to modify and delete,
or the query itself is wrong
if(bs==1&&bl==3)
{OpenBuyLimitOrderEnd(Lot*15,PRAskL);
if (HaveBuyLimitOrderEnd== true)
{ModifyBuyStopOrder(PRAskS);
} }
Yes, it should be, because there are different opening functions and I do not make a request for OrderType () and requested the flag whether it is open, but the problem is most likely not in this function because the other requests also do not work this I first threw, AND ON THE SAME FUNCTION OPEN NORMALLY
SO THE PROBLEM IS WITH THE QUERY IN THE OPERATOR
I wonder if in functions marked red HaveBuyLimitOrderEnd is set in the pipe. If not, you need to call Myorders() before if. Otherwise you do not know what is there. And just in case, the flags (variables)
HaveBuyOrder = false;
HaveSellOrder = false;
HaveBuyStopOrder = false;
HaveSellStopOrder = false;
HaveBuyLimitOrder = false;
HaveSellLimitOrder = false;
HaveBuyLimitOrderEnd = false;
HaveSellLimitOrderEnd = false;
must be defined at global level .
I wonder if the HaveBuyLimitOrderEnd flag is set in red in the pipe. If not, you need to call Myorders() before if. Otherwise you don't know what is there. And just in case, flags (variables)
HaveBuyOrder = false;
HaveSellOrder = false;
HaveBuyStopOrder = false;
HaveSellStopOrder = false;
HaveBuyLimitOrder = false;
HaveSellLimitOrder = false;
HaveBuyLimitOrderEnd = false;
HaveSellLimitOrderEnd = false;
must be defined globally.
it is at a glabal level
bool HaveBuyOrder; // flag if there are open market buy orders
bool HaveSellOrder; // flag flag of open market orders to sell
bool HaveBuyStopOrder; // flag of open pending Buy orders
bool HaveSellStopOrder; // flag of open pending Sell orders
bool HaveBuyLimitOrder; // flag of open pending Buy orders
bool HaveSellLimitOrder; // flag of open pending Sell orders
bool HaveBuyLimitOrderEnd; // flag of presence of open pending Buy orders
bool HaveSellLimitOrderEnd; // flag pending Sell orders open
it's in the order opening function.
ticket = OrderSend(Curr_symb,OP_BUYSTOP, Lot, PRAskS, Slippage, SL, TP, 0, Magic, 0, CLR_NONE);
if (ticket > 0) {
HaveBuyStopOrder = true;
if (OrderSelect(ticket, SELECT_BY_TICKET,MODE_TRADES)) Print("function to place a BuyStop order : ", OrderOpenPrice())
}
else Print("Error # ", GetLastError(), " function for placing BuyStop order",MarketInfo(Curr_symb,MODE_ASK));
return(ticket);
}
SO EVERYTHING ELSE WORKS