Forum

What is the best broker?

What is the best broker for a beginner

OrderSend error 130

Hi, i've coded a simple expert advisor , that buy when RSI is under 30, it work perfectly on forex pair like EUR/USD but it don't work on stock pair like AMZN or on BTC/USD for example. I have this error message each time a send order must be sent: BTCUSD,M5: OrderSend error 130 in the journal

200 orders launched, How to fit to only 1?

As you can see on the pictures, i've coded a script that buy when SMA CROSSUP and SELL when SMA CrossDown. However, when i launch the backtests, it first launch 200 trades (BUY or SELL Depending on conditions) and then,the code executes normally except that I then end up with 199 trades which remain

SELL order does not want to launch

void OpenTrade() { MqlTradeRequest Traderequest; MqlTradeResult Traderesult; ZeroMemory (Traderequest); Traderequest.action = TRADE_ACTION_DEAL ; Traderequest.type = ORDER_TYPE_BUY ; Traderequest.symbol = _Symbol ; Traderequest.volume = 0.01 ; Traderequest.type_filling = ORDER_FILLING_FOK ;

'else' - illegal 'else' without matching 'if'

if ( (MovingAverage1[ 0 ]>MovingAverage2[ 0 ]) && (MovingAverage1[ 1 ]<MovingAverage2[ 1 ]) ) if ( PositionsTotal ()== 0 ) { OrderSend (request,result); else if ( PositionsTotal ()== 1 ); CloseAllOrders(); }

HELP TakeProfits Conditions

When I open a trade with the OrderSend() command, there is the basic command to perform the stop loss. In general I insert either a classic stop loss like: "Ask+100*_Point", or through a variable that I would have previously defined via the "extern int" command. Now i would like to go further and

Need help for a simple crossover code

Hello, i'm new in MT4 editor and on this forum. I need some help to correct a code. I'm trying to code a simple crossover script that send a single buy order when the SMA20 cross over the SMA100, and that close the trade when the SMA100 crossover the SMA20. when I Backtest the code on a chart, the