grimoll2e: plz help me
- When you post code please use the SRC button! Please edit your post.
General rules and best pratices of the Forum. - General - MQL5 programming forum - Help you with what? You haven't stated a problem. Show us
your attempt and state the nature of your problem.
No free help
urgent help. - Risk depends on your initial stop loss, lot size, and the value of the pair.
- You place the stop where it needs to be - where the reason for the trade is no longer valid. E.g. trading a support bounce the stop goes below the support.
- Account Balance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the SPREAD, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
- Do NOT use TickValue by itself - DeltaPerLot
- You must normalize lots properly and check against min and max.
- You must also check FreeMargin to avoid stop out

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 want return(lot_buy) in OrderSend(Symbol(),OP_SELL,********,Bid,2,ssl,stp,NULL,Magicnumber,0,clrRed);
plz help me
void OpenSellOrder()
}
void CloseBuyOrder()
{
for(int i=0;i<total;i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
if(OrderSymbol()!=Symbol()||OrderType()<2)
{
if(OrderType()==0)
{
OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,Black);
}
}
}
}
ouble LotsSize(double lot_buy,double lot_sell)
{
lot_buy=Lots;
lot_sell=Lots;
double lot_buy_plus=0.0;
double lot_sell_plus=0.0;
for(int bl=0;bl<total;bl++)
{
if(OrderSelect(bl,SELECT_BY_POS,MODE_TRADES))
if(OrderType()==0)
{
if(OrderOpenPrice()<OrderClosePrice())
{
lot_buy=lot_buy+Lots+lot_buy_plus;
return(lot_buy);
}
/*else if(OrderOpenPrice()>OrderClosePrice())
{
lot_sell_plus=lot_buy;
}
else if(lot_buy>MaxLots)
{
lot_buy=Lots;
}*/
}
if(OrderType()==1)
{
if(OrderOpenPrice()>OrderClosePrice())
{
lot_sell=lot_sell+Lots+lot_sell_plus;
return(lot_sell);
}
/*else if(OrderOpenPrice()<OrderClosePrice())
{
lot_buy_plus=lot_sell;
}
else if(lot_sell>=MaxLots)
{
lot_sell=Lots;
}*/
}
}
}