친애하는 프로. 도움이 필요하다. 예를 들어 MACD 표시기 가 있습니다. 구조는 iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)입니다. 이 통화 쌍이 아닌 동일한 차트의 다른 통화 쌍에 대한 계산을 얻기 위해 NULL을 변경하는 방법은 무엇입니까? iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)를 수행했지만 아무 것도 발생하지 않습니다. 모든 계산은 0입니다. 옳지 않은 것은?
Michail_David : 친애하는 프로. 도움이 필요하다. 예를 들어 MACD 표시기 가 있습니다. 구조는 iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)입니다. 이 통화 쌍이 아닌 동일한 차트의 다른 통화 쌍에 대한 계산을 얻기 위해 NULL을 변경하는 방법은 무엇입니까? iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)를 수행했지만 아무 것도 발생하지 않습니다. 모든 계산은 0입니다. 옳지 않은 것은?
Michail_David : 친애하는 프로. 도움이 필요하다. 예를 들어 MACD 표시기 가 있습니다. 구조는 iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)입니다. 이 통화 쌍이 아닌 동일한 차트의 다른 통화 쌍에 대한 계산을 얻기 위해 NULL을 변경하는 방법은 무엇입니까? iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)를 수행했지만 아무 것도 발생하지 않습니다. 모든 계산은 0입니다. 옳지 않은 것은?
그리고 그렇게 속이면
//+------------------------------------------------------------------+//| 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);
}
//+------------------------------------------------------------------+
알렉스, 작동하지 않습니다. 이 지표에는 두 통화 쌍에 대해 두 MACD를 동시에 그리는 것이 포함됩니다. 그리고 이 코드를 사용하면 불가능할 정도로 부풀려집니다. 동시에 상관 계산을 추가하고 싶습니다. 그러나 감사합니다. 통화 쌍을 표시해야 하는 형식에 대한 정보를 제공했습니다.
이것은 외환 브로커 또는 무엇입니까?
BANK입니다.
명확하지 않습니다. 알겠습니다.
그들은 MICEX(FORTS)에 있는 것을 기록하고 Alpari에서도 경쟁 계정 에 있는 내용을 말했습니다.
아마도 " 만", "항상"이라는 표현으로. "절대", "아무도" 등은 더욱 조심해야 합니다.
일반 거래 계정에서 다음과 같은 상황 을 알려주세요. 브로커 폐쇄 오픈 포지션 그리고 재발견이 일어났습니까?명확하지 않습니다.
그들은 MICEX(FORTS)에 있는 것을 기록하고 Alpari에서도 경쟁 계정 에 있는 내용을 말했습니다.
아마도 " 만", "항상"이라는 표현으로. "절대", "아무도" 등은 더욱 조심해야 합니다.
일반 거래 계정에서 다음과 같은 상황 을 알려주세요. 브로커 폐쇄 오픈 포지션 그리고 재발견이 일어났습니까?친애하는 프로. 도움이 필요하다. 예를 들어 MACD 표시기 가 있습니다. 구조는 iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)입니다. 이 통화 쌍이 아닌 동일한 차트의 다른 통화 쌍에 대한 계산을 얻기 위해 NULL을 변경하는 방법은 무엇입니까? iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)를 수행했지만 아무 것도 발생하지 않습니다. 모든 계산은 0입니다. 옳지 않은 것은?
시장 리뷰에 "USDJPY" 기호가 있습니까?
친애하는 프로. 도움이 필요하다. 예를 들어 MACD 표시기 가 있습니다. 구조는 iMACD(NULL,0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)입니다. 이 통화 쌍이 아닌 동일한 차트의 다른 통화 쌍에 대한 계산을 얻기 위해 NULL을 변경하는 방법은 무엇입니까? iMACD("USDJPY",0,InpFastEMA,InpSlowEMA,InpSignalSMA,PRICE_CLOSE,MODE_MAIN,0)를 수행했지만 아무 것도 발생하지 않습니다. 모든 계산은 0입니다. 옳지 않은 것은?
그리고 그렇게 속이면
시장 리뷰에 "USDJPY" 기호가 있습니까?
네. 현재, 빅터.
그리고 그렇게 속이면
알렉스, 작동하지 않습니다. 이 지표에는 두 통화 쌍에 대해 두 MACD를 동시에 그리는 것이 포함됩니다. 그리고 이 코드를 사용하면 불가능할 정도로 부풀려집니다. 동시에 상관 계산을 추가하고 싶습니다. 그러나 감사합니다. 통화 쌍을 표시해야 하는 형식에 대한 정보를 제공했습니다.
내가 올바르게 이해했다면 통화 쌍은 표시기에서 통화 쌍을 지정할 때 "EURUSD"와 같은 형식으로 표시되어야 합니다. 이와 관련하여 질문
문자 "를 문자열에 삽입하려면 어떻게 해야 합니까? 통화 쌍이 로그에 "USDJPY"가 아닌 USDJPY로 인쇄되기 때문입니다.
문자 "를 문자열에 삽입하려면 어떻게 해야 합니까? 통화 쌍이 로그에 "USDJPY"가 아닌 USDJPY로 인쇄되기 때문입니다.
https://www.mql5.com/ru/docs/basis/types/stringconst
https://www.mql5.com/ru/docs/basis/types/integer/symbolconstants