Forum

How to increment Lotsize by 0.1?

Hi All I want to increment my lot size by 0.1 but the first lot size has to be my default lot size calculation and then the 2nd lot just increment by 0.1 so on and so forth. I've tried to back test but the increment is incorrect, if there's any better way to do this your help will be appreciated

What is the Order Close Price fucntion in MQL5?

In MQL4 for closing price you would use the function OrderClosePrice(), I want to use the same function in MQL5. Is this the correct function POSITION_PRICE_CURRENT

How to Loop through orders

I want to loop through hedge orders but with this function it's not the correct way. If you know the correct way to loop or how to assemble hedge/hedging again and again please assist. #property strict int MagicNumber= 834856 ; double Filter= 0 ; int BuyTrade= 0 ; int SellTrade= 0 ;

Object Problem

Below I have my supply and demand EA, when attaching my EA everything works fine but the problem is when zooming out on a currency pair my supply and demand rectangles don't appear the same. Instead they appear as resistance and support. This is incorrect as I want my EA to view supply and demand

Buy pending order problem

Hi all My EA will not activate a buy pending order , now I'm assuming the problem might be with the Open predefined variable, if you know the problem please assist. #property strict #include <Trade\Trade.mqh> #include <Trade\SymbolInfo.mqh> #include <Trade\PositionInfo.mqh> #include

Calculate commission per lot

Hi I want to Calculate commission per lot/lot size. The broker I use charges $3.5 per lot, now the problem I'm having is I'm not sure if the calculation below is correct for commission. I use the following before calculating commission: double LotSize() { double LotStep=MarketInfo( Symbol

Trades open once

I want to hedge my trades multiple times instead of once. For example If price opens at buy 1.12345 & sell at 1.12295, how do I hedge my trades at that price multiple times? int MagicNumber=87897; int BuyTrade= 0 ; int SellTrade= 0 ; int Direction= 2 ; int Hedge= 0 ; double Filter= 0 ;

EA Opens trades incorrectly

Please help if you know what's the problem. My EA opens trades incorrectly, it opens the sell trade first instead of the buy which is the moving average . I want to open the buy trade first (Moving average) then if it goes opposite (10 Pips) direction open the sell, vice versa. void OpenTrade() {

Open another trade

I want to open a 2nd trade (if its in profit or a loss within 5 pips), when I execute my 1st trade I would like to open another order. The code below will open when it hits the TP Which is incorrect, please help if you know the problem. bool OpenTradeInProfitOrLoss() { bool Trade= false ; for (

Change timeframes using objects?

Hi All, I want to use my EA on different timeframes without deleting my objects. When I change timeframes my objects don't appear, why is that? if you know the solution please help. #property strict //+------------------------------------------------------------------+ //| Expert deinitialization