Forum

Error 130

Hi, I am getting error 130. I read many articles regarding the same. But couldn't fix the error. because the same code is working with some input and not with some other. I am using NormalizeDouble function for Tradeprice, SL and TP. Pls help me with it. 2020.06.29 14:13:01.637 2020.06.02 04:30:00

What is wrong with my code?

Dear All, I trying to write a code to Trail Stop Loss . ///////////////////////////////Trailing Stoploss////////////////////////////////////////////////// if ( OrdersTotal () >= 1 && startModify) { if ( OrderSelect ( 0 ,SELECT_BY_POS,MODE_TRADES)) { double currentPrice = 0 ;

Error 130

Hi everyone, I am a newbie to MQL. I'm trying a testing EA. I am getting Error#130. Couldn't find the reason. Pls find the code below and copy of the journal below. double Buy_Signal = 0 ; double Sell_Signal = 0 ; int i = 0 ; int Total_Orders = 0 ; int Magic_Check = 0 ; double Lot_Check = 1 ;

Cannot enable "Use hedge in trading" option

Hi Everyone, I tried to open a demo account in MT5 platform. I couldn't enable "Use hedge in trading" option. I couldn't tick it. Please help me to enable it. Thanks in advance

Alternate Function for IndicatorCounted()

Hi, I got an indicator (Open-source) giving buying and selling signal. I am trying to use that "indicator" in an EA. But in that they are using a custom indicator function counted_bars=IndicatorCounted(). I read that (in Documents, here) this function cannot be used in EAs and scripts. Can anyone

How to differentiate an Open Market Order and a Pending Order?

How to differentiate an Open Market Order and a Pending Order ? Here I have tried a test code. I'm placing orders using code and checking some parameters. Please tell me which parameter should be checked whether the order is open or pending. //////////Placing a Pending Order//////////////////////

No. of Lots

Hi, Here I am trying to find out how many 0.1 ( SYMBOL_VOLUME_MIN ) lots are there in a position. I am using below given code to find it. Only BUY-Instant orders are used here. Lot Size is maintained as 0.1 while opening, adding and closing of the position. Position Volume is working good. But Total

Will missing Data affect EA?

Hi, Right now I am back-testing my EA. In EURUSD I find a gap or data-missing. I have attached the screenshot. Is there any way to will it up? or Will that gap disturb while back-testing? If I want to test from 2004 means what should I do? I am using MQL5 .com's demo. With Regards, Krishna

Doubt on OnTrade()

int one = 0 ; int Magic = 1 ; void OnTick () { if (one == 0 ) if (Buy_Call( 0.01 , 1 , "First_Buying_" )) Print ( "Bought" ); } void OnTrade () { one = 1 ; Print ( "One Time" ); } bool Buy_Call( double tp, double lot, string cmt) { MqlTick last_tick;

How to Get Order details from Deal

Hi Friends, This is may be like a re-post. But my doubt is still there. I want to know the following. 1. I placed an Order with TP mentioned. While ENTRY_IN at OPEN_PRICE a DEAL occurs and in ENTRY_OUT at TP again a DEAL occurs. Both the deals are invoked by same order place . So how