Page 1 of 1

New Bar

Posted: Sun Feb 19, 2017 10:47 am
by imamushroom
Hi,

How do I detect a new bar opening (in C++11) in your product please?

Thanks in advance,

Re: New Bar

Posted: Mon Feb 20, 2017 9:19 am
by neHcioHep
Please try something like this

Code: Select all

#include <windows.h>
#include "StrategyInterfaceUnit.h"

TDateTime lastKnownBarTime;
//...

EXPORT void __stdcall InitStrategy()
{
   //...
}

EXPORT void __stdcall DoneStrategy()
{}

EXPORT void __stdcall  ResetStrategy()
{}


EXPORT void __stdcall GetSingleTick()
{
   SetCurrencyAndTimeframe(Currency, Timeframe);
   if (Time[0] != lastKnownBarTime)
   {
      // operations for new bar
      //...
   }
   lastKnownBarTime = Time(0);
}


Re: New Bar

Posted: Tue Feb 21, 2017 11:42 am
by imamushroom
Thanks, I'll give it a go.