Hello everybody
I´m trying to get in C++ (Code::Blocks) the current time (TimeCurrent) and print it in the journal screen but all the time it returns me a 0 value
In "StrategyInterfaceUnit.h" the declaration of TimeCurrent is:
TDateTime TimeCurrent()
{
if (rec.pTimeCurrent == NULL) return false;
return rec.TimeCurrent(rec.pTimeCurrent);
}
My code is:
#include <iostream>
#define DLL_EXPORT
#include <windows.h>
#include "FF2_TimeCurrent.h"
#include "StrategyInterfaceUnit.h"
PChar Currency;
char buff[200];
DECLDIR void InitStrategy()
{
StrategyShortName("TimeCurrent");
StrategyDescription("Print TimeCurrent in Log");
RegOption("Currency", ot_Currency, &Currency);
ReplaceStr(Currency, "EURUSD");
SetCurrencyAndTimeframe("EURUSD", PERIOD_M1);
TDateTime curr_time;
curr_time = TimeCurrent();
sprintf (buff,"Current time: %.6f", curr_time);
Print(buff);
}
DECLDIR void DoneStrategy()
{
free(Currency);
}
DECLDIR void ResetStrategy()
{
}
DECLDIR void GetSingleTick()
{
}
and what I get is in the attached file
May somebody help me
Thanks
TimeCurrent. I can´t get it
-
- Posts: 8
- Joined: Thu Apr 16, 2015 6:04 am
TimeCurrent. I can´t get it
- Attachments
-
- FF2_TimeCurrent.rar
- (63.86 KiB) Downloaded 852 times
Return to “Programming lessons”
Who is online
Users browsing this forum: No registered users and 24 guests