#ifndef ACSIL_CUSTOM_CHART_BARS_H
#define ACSIL_CUSTOM_CHART_BARS_H
struct s_CustomChartBarInterface
{
public:
s_CustomChartBarInterface();
ChartDataTypeEnum ChartDataType;
unsigned char IsDeterminingIfShouldStartNewBar;
unsigned char IsFinalProcessingAfterNewOrCurrentBar;
unsigned char IsInsertFileRecordsProcessing;
s_IntradayRecord NewFileRecord;
uint32_t CurrentBarIndex;
int32_t ValueFormat;
unsigned char IsNewFileRecord;
unsigned char BarHasBeenCutAtStartOfSession;
unsigned char IsNewChartBar;
unsigned char IsFirstBarOfChart;
float TickSize;
unsigned char StartNewBarFlag;
unsigned char InsertNewRecord;
s_IntradayRecord NewRecordToInsert;
float& GetChartBarValue(int SubgraphIndex, int BarIndex);
const SCDateTime& GetChartBarDateTime(int BarIndex);
SCInputRef& GetInput(int InputIndex);
int& GetPersistentInt(int Key);
float& GetPersistentFloat(int Key);
double& GetPersistentDouble(int Key);
int64_t& GetPersistentInt64(int Key);
SCDateTime& GetPersistentSCDateTime(int Key);
void SetLoadingDataObjectPointer(void* p_LoadingDataObject)
{
m_p_LoadingDataObject = p_LoadingDataObject;
}
private:
float& (SCDLLCALL* Internal_GetChartBarValue)(void* p_LoadingDataObject, int SubgraphIndex, int BarIndex);
const SCDateTime& (SCDLLCALL*Internal_GetChartBarDateTime)(void* p_LoadingDataObject, int BarIndex);
SCInputRef & (SCDLLCALL*Internal_GetInput)(void* p_LoadingDataObject, int InputIndex);
int& (SCDLLCALL* Internal_GetPersistentInt)(void* p_LoadingDataObject, int Key);
float& (SCDLLCALL* Internal_GetPersistentFloat)(void* p_LoadingDataObject, int Key);
double& (SCDLLCALL* Internal_GetPersistentDouble)(void* p_LoadingDataObject, int Key);
int64_t& (SCDLLCALL* Internal_GetPersistentInt64)(void* p_LoadingDataObject, int Key);
SCDateTime& (SCDLLCALL* Internal_GetPersistentSCDateTime)(void* p_LoadingDataObject, int Key);
void* m_p_LoadingDataObject;
public:
float BidPrice;
float AskPrice;
const c_VAPContainer *VolumeAtPriceForBars;
private:
int (SCDLLCALL* InternalFormattedEvaluate)(float Value1, unsigned int Value1Format,
OperatorEnum Operator,
float Value2, unsigned int Value2Format,
float PrevValue1, float PrevValue2,
int* CrossDirection) = nullptr;
};
inline float& s_CustomChartBarInterface::GetChartBarValue(int SubgraphIndex, int BarIndex)
{
return Internal_GetChartBarValue(m_p_LoadingDataObject, SubgraphIndex, BarIndex);
}
inline const SCDateTime& s_CustomChartBarInterface::GetChartBarDateTime(int BarIndex)
{
return Internal_GetChartBarDateTime(m_p_LoadingDataObject, BarIndex);
}
inline SCInputRef& s_CustomChartBarInterface::GetInput(int InputIndex)
{
return Internal_GetInput(m_p_LoadingDataObject, InputIndex);
}
inline int& s_CustomChartBarInterface::GetPersistentInt( int Key)
{
return Internal_GetPersistentInt(m_p_LoadingDataObject, Key);
}
inline float& s_CustomChartBarInterface::GetPersistentFloat(int Key)
{
return Internal_GetPersistentFloat(m_p_LoadingDataObject, Key);
}
inline double& s_CustomChartBarInterface::GetPersistentDouble(int Key)
{
return Internal_GetPersistentDouble(m_p_LoadingDataObject, Key);
}
inline int64_t& s_CustomChartBarInterface::GetPersistentInt64(int Key)
{
return Internal_GetPersistentInt64(m_p_LoadingDataObject, Key);
}
inline SCDateTime& s_CustomChartBarInterface::GetPersistentSCDateTime(int Key)
{
return Internal_GetPersistentSCDateTime(m_p_LoadingDataObject, Key);
}
typedef s_CustomChartBarInterface& SCCustomChartBarInterfaceRef;
typedef void (SCDLLCALL* fp_ACSCustomChartBarFunction)(SCCustomChartBarInterfaceRef);
#endif