Forum

How to export Bollinger Band data to Excel in Metatrader 5?

How to export Bollinger Band data to Excel in Metatrader 5

Code error - Open Buy & Sell trades using Nadaraya Envelope

I have used the code of Nadaraya Envelope from LuxAlgo, the indicator code is as below //+------------------------------------------------------------------+ //| nd.mq5 | //| Copyright 2022, MetaQuotes Ltd. |

What is the error in this code? I want to calculate the number of open orders (Buystops/sellstops or Buylimits/selllimits)

Some experts please tell what is wrong with the below code, it is not counting the open orders? int Nropen( int option){ int nrop= 0 ; for ( int ord= HistoryOrdersTotal ()- 1 ; ord>= 0 ; ord--){ ulong ticket= OrderGetTicket (ord); if ( OrderSelect (ticket)){ if (

Drawdown & Balance Drop without Stoploss

Hi, someone please clarify, how the balance in the account will come down, when there is no stoploss given. See the below image, it is showing a drawdown which is at the midlevel and the balance blue line is touching upto the bottom, sometimes during testing, the balance drawdown is going negative

Getting Error - no one of the overloads can be applied to the function call

I am getting the following error in the below code, request you to help plz, i want to delete the pending orders using the magic number void DeleteAll() { for ( int ord= OrdersTotal ()- 1 ; ord>= 0 ; ord--) if (orderInfo.SelectByIndex(ord) && OrderGetInteger ( POSITION_MAGIC )==Magic){

Invalid Volume Error in EA

Hi, I am using the following formula for the volume, and while multiplying it is giving result in digits and am getting invalid volume error while testing trade.BuyStop(( 5 *Buyvolume*LotMultiplier),( SymbolInfoDouble ( Symbol (), SYMBOL_ASK )+ 3 ), Symbol (), 0 , 0 , ORDER_TIME_GTC , 0 ,commStr);

Expert Advisor Code Not working, what am missing?

The below code not executing the sellstop order . What is that am missing? I want the sell stop to get executed once the buy order is placed. trade.Buy( 0.10 , Symbol (), SymbolInfoDouble ( Symbol (), SYMBOL_ASK ), 0 , 0 ,commStr); if (count_buys== 1 ){ trade.SellStop( 0.10 ,( SymbolInfoDouble (

Once Stoploss hits, next 15 minutes EA should not trade

My stoploss code is as below, once stoploss is hit, next 15 mins EA should stop trading, how should i modify the below code if (SL_Type== 0 && NroTrade( 1 )> 0 && TotalProfit( 1 )<=SellSL*LotMult*neg){ CloseAll( 1 ); ResetTicket( 1 ); }

Magic Number in EA

I need a clarification on the Magic Number in EA. I have given the Magic Number in all my EA's as below int Magic=MathRand(); I have parallelly running 4 EA's, whenever a trade is getting executed, each EA executes the trades with a different magic number. As long as the EA's are not refreshed/not

Trade based on RSI value when moving from top to bottom?

Hi, Is there a way to code to buy or sell only when it touches the value while coming from top to bottom? I mean, the condition for buy is when RSI value touches 30 and for sell, when RSI value touches 70. But I don't want the trade to happen when RSI moves from 35 to 30 instead i want the trade to