+1 888 340 6572
MultiCharts Project Management
Go to the previous open issue
Go to the previous issue (open or closed)
Please log in to bookmark issues
Open Feature request MC-1569

Not possible to access the Time of the calculated Tick

Go to the next issue (open or closed)
Go to the next open issue

multicharts is a great software!
But the implementation of features are  some times not consistent but scattered.
Problem It is not possible to access the tick's timestamp. a tick is a price, a time and a volume.

If you ever tried to implement a strategy with daily bars with IOG (bar magnifier) and with a time condition. e.g. entry set up is true and time = xxxx buy next bar (tick)...
The developer will find various functions such Time, CurrentTime, TradeTime etc. unfortunately these gives different result depending on the application and mode of testing.
The developer expect a function that works consistently accross all application and modes of operation (design, test (backtest, playback, portfolio backtest) and realtime).
Time function = Only works (provide grannular timestamp) in Chart, IOG w. bar magnifier mode. In "Realtime or play back mode it gives the session close time. i.e. useless for time condition.

TradeTime = only give Bar close (session close) time - one minute. In playback mode it returns 0.00. i.e. useless for time condition.

CurrentTime = Only work in realtime mode with the risk of combining two different source. i.e. market price and local computer timestamp. This is not best practice. a price and time are tightly coupled and should come from market!
Portfolio tester is behind in support of IOG and Bar Magnifier, so using time condition on daily bars is not even possible.

Using two data series i.e. 5 minute (data1) and Daily (data2) to achieve intraday order execution on daily data calculation is not possible too, since Bar Magnifier is not supported in Portfolio Tester and not on data2. i.e. Indicators such RSI can not be properly calculated until session is close (bar close)

I have discussed this with MC support and only got the suggestion to determine whether signal is executed realtime or in backtest mode by using getappinfo(aiRealTimeCalc) to determine whether realtime or backtest. and then use currentTime for realtime and Time for backtest. This is a bad workaround and do not support play back mode exectution.

What is missing that would solve a lot of problems with MC and time based strategies are a time function that return the time of the current tick calculated. i.e. not the expected time of close of the bar.

Please prioritice this! Most swing based strategies uses daily data and intraday order execution (before close). There is strong need for proper time condition functionality!
Thanks for a fantastic software! Love to see the improvements!

Steps to reproduce this issue

Run a simple print program with the availale time functions in on a daily chart:
Chart - backtest, IOG, Bar Magnifier minute
Chart - Playback, IOG, Resolution more grannluar that day.
Portfolio Backtest.

Record the output of each run and compare. You will find there is no function that consistently return the time of the price currently being calculated.

Example print code
[IntrabarOrderGeneration = True];
"Ver : ","1",
" Bar  : ",BarNumber,
" date: ",date,
" getappinfo(aiRealTimeCalc): ",getappinfo(aiRealTimeCalc),
" getappinfo(aiApplicationType): ",getappinfo(aiApplicationType),
" time_sym: ",symbol_datetime,
" time: ",time,
" TradeTime: ",tradetime,
" sym_tick: ",symbol_ticks,
" currentTime: ",currenttime,
" Data: ",c,
" RSI2_d1: ",rsi(c,2));

Comments (3)
user-offline.png  MultiCharts Support (MultiCharts)
Jan 14, 2014 - 10:09

Have you tried to use "Enable access to intra-bar time for calculation in Intra-Bar Order Generation mode" feature of Bar Magnifier? For some keywords, it should help. For others - it is a feature request. like to get exact trade time.

user-offline.png  jimpe (jimpe606)
Jan 14, 2014 - 14:59

yes all combination are tested as far I can see. The overview is shared on link below.
Test uses: IOG, Bar Magnifier (minute data), "Enable access to Intra-bar time for..."
Worst is that there is no combination that support Portfolio Backtester or Chart Play back.

user-offline.png  McGeorge (McGeorge)
icon_reply.pngFeb 28, 08:21, in reply to comment #0

I experienced the same timestamp problem when I compared signal results between backtesting and plackback. The problem of different return value from Time keyword when "Enable access to intra-bar time for calculation in Intra-Bar Order Generation Mode" is checked or unchecked caused a lot of confusion and it took me hours troubleshooting the error. All users should share the the same frustration if they carefully look into their backtesting results.

In my opinion, the Time keyword should consistently return the end time of a bar, no matter intra-bar time is enabled in setting or not. If a user wants to get the time of a tick, the user should use a different keyword to get it. As such keyword is currently not available in PowerLanguage, it is badly needed that MC creates a new keyword (E.g. DateTime_Tick, Time_Tick, etc.) for that purpose.

Issue basics
  • Type of issue
    Feature request
  • Category
  • Targeted for
    Not determined
  • Status
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (2)
People involved
Times and dates
  • Posted at
  • Last updated
Issue details
  • Resolution
    Not determined
  • Severity
Attachments (0)
There is nothing attached to this issue
Commits (0)
There are no code checkins for this issue
Duplicate issues (0)
This issue does not have any duplicates