Forum

implicit enum conversion - enum to int

Hi! I want to explicitly convert 'enum' type into 'int' type. // --- global variables --- enum TRADE_TYPE{DontTradeType,TradeType,BuyOnlyType,SellOnlyType};TRADE_TYPE Trade_type; // then I pass 'Trade_type' into function call - SetBtnText(setSparam, Trade_type); // --- TRADE BUTTON TOGGLE

MT4 (bld 765+) - Buttons on chart example

Hello! Attached is raw EA, which should, to some of us, serve as an example of coding and using (simple) buttons on MT4 chart. EA goes under Experts folder. <ChiFunctions.mqh> goes under Include folder. Then compile and test. Buttons toggle between preset states/values, and change color and text

datetime to string

Hi! I am, obviously unsuccessfully, trying to paste datetime into string: datetime dt_EAExpires= D'2016.12.31 23:59' ; extern string EA_expires_txt= "--- EA expires on: " + TimeToString (dt_EAExpires, TIME_DATE | TIME_MINUTES )+ " ---" ; /*2016.12.31 23:59 ---";*/ // --- EXPIRATION DATE --- This

string array[] ={"a",...} - ObjectDescription(array); ObjectDelete()

Hi! On chart, I have TREND and HORIZONTAL lines ; 'Description' fields are filled with 'orders'; 'orders' are recognized by crossedLine() function - if price crosses the line (trend or horizontal), do something...; 'orders' are {"buy", "sell"...}; if line has 'order' "delete_trading_lines", I want

for loop - skip last 6 objects on chart, delete all others

Hi! My ea puts opening and closing arrows plus trend lines connecting them on chart. It names those objects, starting with '#'. When testing, for the sake of not cluttering the chart, I want to delete all those chart objects (starting with '#') but last 6. I have been riddling this quest for few

Select -all- vertical and trend lines on chart

Hi! I just can't find sample code to select either vertical or trend line (actually both) on chart. The idea is to (toggle with button) hide/show objects on chart, i.e. vertical and trend lines (which clutter my chart, but i am possessed (LOL) and addicted (LOL again) by them; I need them as much as

'ObjectFind' - pass 'object_name' parameter forward into...

Hi! Is there a short way to pass 'object_name' parameter from ObjectFind() forward into another (custom) function ? Like: int OnInit () { ... if ( ObjectFind ( 0 , "above" )== 0 || ObjectFind ( 0 , "below" )== 0 ) TrailHLineOnChart(AboveOrBelow); // i.e. object (horizontal line) with object_name

EA enable trade, then when one trade is opened, disable trade parameter (trade only once)

Hi! I have EA which has global variable [bool Trade=false;]. I need a function that would check if a line on chart has been crossed, it will enable trade [Trade=true;] , then 'wait' for 1 order to be opened (when trading conditions are met), and then disable the trade [Trade=false;]. Currently this

Object multiple timeframes visibility as external parameter / input (OBJ_PERIOD_X|...)

Hello! I have a script, which plots data from .csv, as vertical lines with (or without) text. At the script start, I would like to be able to select timeframes that those vertical lines (and text) should be plotted on. Like: input int PlotOnTimeframes = 60, 240, 1440;

Plot vertical lines from csv file

Hello! I have a script which plotted vertical lines from csv file. Now it is not working anymore. Can someone please help me and revise the code, and fix it. Attached is script and csv file, which goes under ...MQL4/Files folder. Thank you for your help, Best regards, Simon