Morteza Khorasani
Morteza Khorasani
Morteza Khorasani
Added topic using symbols other than metatrader predefined symbol
Hi I want to write an indicator. But I do not want to use predefined symbols. for example as you see in the definition of iMA indicator: double   iMA (     string         symbol
Morteza Khorasani
Added topic use indicator in a multi symbol or hybrid symbol expert
Hi I want to use mql4 indicators for a symbol that I have defined myself. For example I want an indicator for a new symbol like: ( EURUSD -EURJPY) or (EURUSD/EURJPY) or (EURUSD+2*EURJPY) something like what tradingview website does. Indicators in
Morteza Khorasani
Added topic Current price on the chart
What is the current price shown on the chart is it bid price or ask price. Or an average of these two? I have an expert that do a job when the current price reach a predefined price how to define the current price? For example I open a long position
Morteza Khorasani
Added topic show indicators
Hi I have an expert that works with ichimoko and moving averages .. I want to see these indicators on the chart. Is there any way to call them to be shown on the chart without coding too much... for example I want a simple moving averge with default
Morteza Khorasani
Added topic Different SHIFT Number for different currency pairs
Hi I have an expert that works with  candles in the past for two or three currency pairs . For example I want to know the open price for GBPJPY for the candle of 2019.01.01 11:02.  using the code below:(FirstPair and some_date are
Morteza Khorasani
Added topic reading data from file without removing expert
I have an expert that write some data into a file . But I can not open the file or read data from the file via another expert until I remove expert. I see a message that tells me the file is using by another program. Is there a way to read data or
Morteza Khorasani
Added topic Different backtesting result
Why do I have gain different results when backtesting an EA on two different systems? Same Ea, same setting, same broker, same starting and end date
Morteza Khorasani
Added topic Why this always returns false?
Hello I wrote a boolean function . This code always returns false. I wrote some print order to check the program. I have the value of the deviation and the function prints the calculated value of Parameter2. Most of times it meets the
Morteza Khorasani
Added topic Decode EA
I have written an expert advisor. I want to give it to a trader. I‌s it possible that someone decodes the EX4 files.  V‌ersion of meta editor : 5 buld 1526
Morteza Khorasani
Added topic Prevent code from Calling OnTick()
I want to add the expiry check in the OnInit() section and if returns false , I want to prevent it from going ahead. And I want to stop the code. ‌‌I have written this: int OnInit ()   { //--- if (expirationdate() != true ) { Alert (
Morteza Khorasani
Added topic Text ON chart
Hello I‌ placed a text object on chart B‌ut only a part of my text is shown on the chart. ‌ And it only occupies halp of the chart width. ‌ ObjectCreate (objname3, OBJ_LABEL , 0 , 0 , 0 );    ObjectSet (objname3, OBJPROP_XDISTANCE , x3);
Morteza Khorasani
Added topic initial negative profit
Hello I want to know how to calculate the initial negative profit immediately after opening a position. Is it just a function of spread and lotsize? Or there are something else that must be considered//?  Please tell me the formula for
Morteza Khorasani
Added topic Minutes elapsed
How to calculate the minute elapsed since opening a position Can this be true: if ( TimeMinute ( TimeCurrent ())- TimeMinute (opentime)> 60 ) { .... }  
Morteza Khorasani
Added topic Are these two line the same?
if ( Minute ()== 0 ) { } vs. if ( TimeMinute ( TimeCurrent ())== 0 ) { }  
Morteza Khorasani
Added topic A short code to add expiration date and time for expert
I need a short code to add expiration date and time to my expert. void OnTick () { //1 if (!expire) { //2 expert body } //2 else message( "Expired" ); } //1 bool expire() { if expiration date reached return ( 1 ) else if exp date did not reached
Morteza Khorasani
Added topic Write a text on a specific coordinate of chart
I want to get the output result of a function and show it on the chart:    ObjectCreate (pastaverage, OBJ_LABEL , 0 , 0 , 0 );    string value1= DoubleToStr (checkaverage(), 7 );    ObjectSetText (pastaverage, "Average
Morteza Khorasani
Added topic Obtaining the average high value of previous bars
Hello I want to obtain the high price of the previous candles and calculate the average price . double average1() { //average1 start double highfirst[]; CopyHigh (FirstSymbol,timeframe, 0 , 50 ,highfirst); sum= 0 ; for ( int k= 0 ;k<=noofbars;k++)
Morteza Khorasani
Added topic Calculating total profit/loss in orders of the same magic number.
void checkprofit() { double dblProfit= 0 ; int POS= 0 ; bool boolTerm= false ; while (boolTerm== false )                   { //4-2-1
Morteza Khorasani
Added topic What is wrong?
Hi I wrote an expert to open two position at the same time. and close them when the total profit/loss of the two order reach the profit/koss target. User can enter the symbol names and type of two orders as input. I did this: input string
Morteza Khorasani
Registered at MQL5.community