Forum

Invalid Price using Stoplevels & FreezeLevels

Hi All I want to use trail my buy stop and sell stop orders but I encounter invalid price error when using the code below. input double TakeProfit= 5 ; input double StopLoss= 2 ; input double PendingStopTrail= 2 ; int MagicNumber; double Filter= 0 ; int Direction= 0 ; int StopLevel=( int )

Script: Invalid Stops Take Profit & Stop Loss (Sell Positions)

Hello All My modify TP/SL code below won't modify sell positions instead I get modify errors . With Buy positions everything modifies as normal, please assist me as to why sell positions will not modify. #include <Trade\Trade.mqh> #include <Trade\SymbolInfo.mqh> #include <Trade\PositionInfo.mqh>

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() {