They write that this is available onthe MICEX (FORTS), and Alpari also said that they have it oncompetitive accounts.
Perhaps with the expressions "only", "always". "never", "no one but" and the like should be more careful.
Can you tell me ifthere is a situation on a regular trading account wherethe broker has closedthe open positionsand opened them again?
It is an individual situation, in Ukraine banks are required by law to close transactions in the foreign exchange market during the current day (for reporting purposes).
Dear Professionals. We need some help. For example we have a MACD indicator. Its structure is iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0). How can I change NULL to get calculations not for this currency pair but for another one on the same currency pair chart? I put iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0), but it brings me nowhere. All calculations are null. What's wrong with it?
Michail_David: Dear Professionals. I need some help. For example, we have a MACD indicator. Its structure is iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0). How can I change NULL to get calculations not for this currency pair but for another one on the same currency pair chart? I put iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0), but it brings me nowhere. All calculations are null. What's wrong with it?
Is there a "USDJPY" symbol in the market overview?
Michail_David: Dear Professionals. I need your help. For example, we have a MACD indicator. Its structure is iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0). How can I change NULL to get calculations not for this currency pair but for another one on the same currency pair chart? I put iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0), but it brings me nowhere. All calculations are null. What's wrong with it?
And if you cheat like this
//+------------------------------------------------------------------+//| ExamplesMACD.mq5 |//| Copyright 2009-2020, MetaQuotes Software Corp. |//| http://www.mql5.com |//+------------------------------------------------------------------+#property copyright"2009-2020, MetaQuotes Software Corp."#property link"http://www.mql5.com"#property description"Moving Average Convergence/Divergence"#include <MovingAverages.mqh>
//--- indicator settings#property indicator_separate_window#property indicator_buffers4#property indicator_plots2#property indicator_type1DRAW_HISTOGRAM#property indicator_type2DRAW_LINE#property indicator_color1 Silver
#property indicator_color2 Red
#property indicator_width12#property indicator_width21#property indicator_label1"Examples MACD"#property indicator_label2"Examples Signal"//--- input parametersinputstring InpPara="USDJPY"; // Parainputint InpFastEMA=12; // Fast EMA periodinputint InpSlowEMA=26; // Slow EMA periodinputint InpSignalSMA=9; // Signal SMA periodinputENUM_APPLIED_PRICE InpAppliedPrice=PRICE_CLOSE; // Applied price//--- indicator buffersdouble ExtMacdBuffer[];
double ExtSignalBuffer[];
double ExtFastMaBuffer[];
double ExtSlowMaBuffer[];
int ExtFastMaHandle;
int ExtSlowMaHandle;
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+voidOnInit()
{
//--- indicator buffers mappingSetIndexBuffer(0,ExtMacdBuffer,INDICATOR_DATA);
SetIndexBuffer(1,ExtSignalBuffer,INDICATOR_DATA);
SetIndexBuffer(2,ExtFastMaBuffer,INDICATOR_CALCULATIONS);
SetIndexBuffer(3,ExtSlowMaBuffer,INDICATOR_CALCULATIONS);
//--- sets first bar from what index will be drawnPlotIndexSetInteger(1,PLOT_DRAW_BEGIN,InpSignalSMA-1);
//--- name for indicator subwindow labelstring short_name=StringFormat("ExamplesMACD(%d,%d,%d)",InpFastEMA,InpSlowEMA,InpSignalSMA);
IndicatorSetString(INDICATOR_SHORTNAME,short_name);
//--- get MA handles
ExtFastMaHandle=iMA(InpPara,0,InpFastEMA,0,MODE_EMA,InpAppliedPrice);
ExtSlowMaHandle=iMA(InpPara,0,InpSlowEMA,0,MODE_EMA,InpAppliedPrice);
}
//+------------------------------------------------------------------+//| Moving Averages Convergence/Divergence |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constdatetime &time[],
constdouble &open[],
constdouble &high[],
constdouble &low[],
constdouble &close[],
constlong &tick_volume[],
constlong &volume[],
constint &spread[])
{
if(rates_total<InpSignalSMA)
return(0);
//--- not all data may be calculatedint calculated=BarsCalculated(ExtFastMaHandle);
if(calculated<rates_total)
{
Print("Not all data of ExtFastMaHandle is calculated (",calculated," bars). Error ",GetLastError());
return(0);
}
calculated=BarsCalculated(ExtSlowMaHandle);
if(calculated<rates_total)
{
Print("Not all data of ExtSlowMaHandle is calculated (",calculated," bars). Error ",GetLastError());
return(0);
}
//--- we can copy not all dataint to_copy;
if(prev_calculated>rates_total || prev_calculated<0)
to_copy=rates_total;
else
{
to_copy=rates_total-prev_calculated;
if(prev_calculated>0)
to_copy++;
}
//--- get Fast EMA bufferif(IsStopped()) // checking for stop flagreturn(0);
if(CopyBuffer(ExtFastMaHandle,0,0,to_copy,ExtFastMaBuffer)<=0)
{
Print("Getting fast EMA is failed! Error ",GetLastError());
return(0);
}
//--- get SlowSMA bufferif(IsStopped()) // checking for stop flagreturn(0);
if(CopyBuffer(ExtSlowMaHandle,0,0,to_copy,ExtSlowMaBuffer)<=0)
{
Print("Getting slow SMA is failed! Error ",GetLastError());
return(0);
}
//---int start;
if(prev_calculated==0)
start=0;
else
start=prev_calculated-1;
//--- calculate MACDfor(int i=start; i<rates_total && !IsStopped(); i++)
ExtMacdBuffer[i]=ExtFastMaBuffer[i]-ExtSlowMaBuffer[i];
//--- calculate Signal
SimpleMAOnBuffer(rates_total,prev_calculated,0,InpSignalSMA,ExtMacdBuffer,ExtSignalBuffer);
//--- OnCalculate done. Return new prev_calculated.return(rates_total);
}
//+------------------------------------------------------------------+
Alex, it won't work. The indicator is supposed to draw two MACDs simultaneously for two currency pairs. However, with this code it is getting impossibly bloated. I also want to add calculation of correlation. But thanks for the tip on how the currency pair should be specified.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
is it a forex broker or something?
This is BANK.
It's not clear, but okay.
They write that this is available onthe MICEX (FORTS), and Alpari also said that they have it on competitive accounts.
Perhaps with the expressions "only", "always". "never", "no one but" and the like should be more careful.
Can you tell me, in regular trading accounts, whena broker closesan open positionand then reopens it?It's not clear, but okay.
They write that this is available onthe MICEX (FORTS), and Alpari also said that they have it on competitive accounts.
Perhaps with the expressions "only", "always". "never", "no one but" and the like should be more careful.
Can you tell me ifthere is a situation on a regular trading account wherethe broker has closedthe open positionsand opened them again?Dear Professionals. I need some help. For example, we have a MACD indicator. Its structure is iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0). How can I change NULL to get calculations not for this currency pair but for another one on the same currency pair chart? I put iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0), but it brings me nowhere. All calculations are null. What's wrong with it?
Is there a "USDJPY" symbol in the market overview?
Dear Professionals. I need your help. For example, we have a MACD indicator. Its structure is iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0). How can I change NULL to get calculations not for this currency pair but for another one on the same currency pair chart? I put iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0), but it brings me nowhere. All calculations are null. What's wrong with it?
And if you cheat like this
Is the symbol "USDJPY" present in the market overview?
Yes. It is, Victor.
and if you cheat like this.
Alex, it won't work. The indicator is supposed to draw two MACDs simultaneously for two currency pairs. However, with this code it is getting impossibly bloated. I also want to add calculation of correlation. But thanks for the tip on how the currency pair should be specified.
If I understand correctly, the currency pair should be specified as "EURUSD" in any indicator. In this regard, my question is
How can I insert the symbol " in string? Because the currency pair is printed in the journal as USDJPY, not "USDJPY".
How can I insert the " symbol in the line? As the currency pair in the magazine is printed as USDJPY instead of "USDJPY".
https://www.mql5.com/ru/docs/basis/types/stringconst
https://www.mql5.com/ru/docs/basis/types/integer/symbolconstants