newbie98:
Hi Everyone,
I am just getting started in MT4 and wrote a short function. Lots of errors on brackets and other.
Any help would be great! Thanks
<CODE DELETED>
Please read some other posts before posting . . .
Please edit your post . . . please use the SRC button to post code: How to use the SRC button.
if ( BaseTradeOpen( OrderSymbol(), MagicNumberLong, Long ) && SubsignalTradeOpen( OrderSymbol(), MagicNumberLong, Long ) )
Don't write unreadable code.
bool isBaseOpen = BaseTradeOpen( OrderSymbol(), MagicNumberLong, Long ), isSubSignal = SubsignalTradeOpen( OrderSymbol(), MagicNumberLong, Long ); if(isBaseOpen && isSubSignal)

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
Hi Everyone,
I am just getting started in MT4 and wrote a short function. Lots of errors on brackets and other.
Any help would be great! Thanks
if BaseTradeOpen(OrderSymbol(), MagicNumberLong, Long) && SubsignalTradeOpen(OrderSymbol(), MagicNumberLong, Long)
{
//OrderSelect(BuySubsignal,SELECT_BY_TICKET);
OpenPrice = Ask;
LotSize = LotScale*OrderLots();
// Calculate stop loss and take profit
if(StopLoss > 0) double BuyStopLoss = OpenPrice - (StopLoss * UsePoint);
if(TakeProfit > 0) double BuyTakeProfit = OpenPrice + (TakeProfit * UsePoint);
// Open buy order
BuyTicket = OrderSend(Symbol(),OP_BUY,LotSize,OpenPrice,UseSlippage,BuyStopLoss,BuyTakeProfit,"Buy Order",MagicNumberLong,0,Green);
}