//+------------------------------------------------------------------+//| |//+------------------------------------------------------------------+int CNewBar::PrevCalculated( void )
{
int pc=( int )( this .RatesTotal()- this .m_rt);
return (pc);
}
//+------------------------------------------------------------------+//| CNewBar IsNewBar Основная функция класса |//+------------------------------------------------------------------+bool CNewBar::IsNewBar( void )
{
datetime tm= this .Time();
Print ( "this.m_time " , this .m_time, " tm " ,tm, " this.m_pc " , this .m_pc, " this.m_rt " , this .m_rt);
if (tm== 0 )
returnfalse ;
if (tm!= this .m_time)
{
//--- определяем времяthis .m_time=tm;
//--- определяем кол-воthis .m_pc= this .PrevCalculated();this .m_rt=( int ) this .RatesTotal();returntrue ;
}
this .m_pc=( int ) this .m_rt;returnfalse ;
}
class CNewBar : public CObject
{
private :
string m_symbol;
ENUM_TIMEFRAMES m_timeframe;
datetime m_time;
int m_rt;
int m_pc;
datetime Time( void );
int PrevCalculated( void );
int RatesTotal( void );
stringSymbol ( void ) { returnthis .m_symbol; }
public :
ENUM_TIMEFRAMES Timeframe( void ) { returnthis .m_timeframe; }
datetime GetTime( void ) { returnthis .m_time; } // Возвращает время последнего обращенияint GetRatesTotal( void ) { returnthis .m_rt; }
int GetPrevCalculated( void ) { returnthis .m_pc; }
bool IsNewBar( void ); // Основная функция класса
CNewBar( conststring symbol, constENUM_TIMEFRAMES timeframe);
~CNewBar( void ) {;}
};
//+------------------------------------------------------------------+//| Кол-во отработанных |//+------------------------------------------------------------------+int CNewBar::PrevCalculated( void )
{
int _rt= this .RatesTotal();
int rt=_rt-(_rt- this .m_rt);
return (rt < 0 ? 0 : rt);
}
//+------------------------------------------------------------------+//| CNewBar IsNewBar Основная функция класса |//+------------------------------------------------------------------+bool CNewBar::IsNewBar( void )
{
datetime tm= this .Time();
int rt= this .RatesTotal();
if (tm== 0 )
returnfalse ;
if (tm!= this .m_time)
{
//--- определяем времяthis .m_time=tm;
//--- определяем кол-воthis .m_pc= this .PrevCalculated();
this .m_rt=rt;
returntrue ;
}
this .m_pc=rt< 0 ? 0 : rt;
returnfalse ;
}
그러나 어떤 이유로 값을 시작할 때 0은 노란색 줄무늬로 표시됩니다.
//+------------------------------------------------------------------+//| Expert initialization function |//+------------------------------------------------------------------+intOnInit ()
{
for ( int i= 1 ; i< 2 ; i++)
{
ENUM_TIMEFRAMES n_period=( ENUM_TIMEFRAMES )GetPeriodEnumerator(( uchar )i);
CNewBar *nb = new CNewBar( Symbol (), n_period);
if (nb== NULL )
continue ;
if (!list_new_bar.Add(nb))
{
delete nb;
continue ;
}
Print (nb.IsNewBar(), " ***** " , Symbol (), " ***** " , nb.Timeframe(), " RatesTotal " ,nb.GetRatesTotal(), " Calculated " ,nb.GetPrevCalculated());
}
//--- create timerEventSetTimer ( 1 );
//---return ( INIT_SUCCEEDED );
}
//+------------------------------------------------------------------+//| Расчет цены |//+------------------------------------------------------------------+int CNewBar::PriceHL2( void )
{
int res= ArrayResize ( this .m_pr_hl2, this .m_rt);
for ( int b= this .m_pc; b< this .m_rt; b++)
m_pr_hl2[b]= MathAbs (( iHigh ( this .m_symbol, this .m_timeframe,b) + iLow ( this .m_symbol, this .m_timeframe,b))/ 2 );
return (res);
}
하지만 Expert Advisor에서 어레이를 뽑을 수는 없지만 디버깅하는 동안 값이 나옵니다.
그것을 전문가에게 밀어 넣는 것이 어떻게 더 글을 읽을 수 있습니까? 계산에 필요한 매개변수
어떻게 하는지 알 수 없는 prev_calculated의 계산을 유사하게 구성하는 방법을 제안할 수 있습니까? 수업을 진행하기가 어렵습니다.
그렇게 했더니 좀 더 합리적인 방법을 알려주시면 대박이겠네요!!!
이것은 시스템에 더 유용하지만 지속 가능성 측면에서 내가 한 것보다 더 효율적이라고 생각합니다.
그렇게 했더니 좀 더 합리적인 방법을 알려주시면 대박이겠네요!!!
헛소리 깨진 논리. 아래가 더 정확합니다.
그러나 어떤 이유로 값을 시작할 때 0은 노란색 줄무늬로 표시됩니다.
헛소리 깨진 논리. 아래가 더 정확합니다.
그러나 어떤 이유로 값의 시작 부분에 노란색 줄무늬가 표시된 0이 있습니다.
당신은 단지 새로운 바를 구축하고 있습니까?
당신은 단지 새로운 바를 구축하고 있습니까?
전략을 구현하려면 매개변수가 필요합니다.
그리고 모든 TF를 분류할 수 있는 기능이 있는 보너스로 새로운 바
여전히 각 막대의 가격을 계산해야 합니다.
하지만 Expert Advisor에서 어레이를 뽑을 수는 없지만 디버깅하는 동안 값이 나옵니다.
그것을 전문가에게 밀어 넣는 것이 어떻게 더 글을 읽을 수 있습니까? 계산에 필요한 매개변수
안녕하세요 여러분! 거래 로봇 과 거래 고문 의 차이점이 무엇인지 알려주십시오.
익살.
예를 들어, 하위 창에 무언가를 쓰거나 그리는 것입니다.
"IndicatorGetInteger" 유형의 명시적 기능을 찾지 못했습니다.
표시기는 하위 창의 번호를 어떻게 알 수 있습니까?
예를 들어, 하위 창에 무언가를 쓰거나 그리는 것입니다.
"IndicatorGetInteger" 유형의 명시적 기능을 찾지 못했습니다.