Counter of days

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #170131 quote
    Albaran
    Participant
    Average

    Hi there,

    If one were to use below code :

    If not onmarket then
       MyDate = undefined
    elsif not onmarket[1] and onmarket then
       MyDate = Date
    Endif

    would below kind of line work as a counter of days or will it give an error? :

    Date - MyDate = X (number of days?)

    Cheers,

    #170146 quote
    robertogozzi
    Moderator
    Master

    The only data type supported is floating point NUMERIC, no text (strings), nor dates/time, no integers.

    So there’s no date/time math available.

    You can do with tricks and extra coding by thinking of them as numbers, but you will have to account for max days for months, leap years, etc… yourself.

    You may want to read this https://www.prorealcode.com/reply/94795/.

    #170151 quote
    Paul
    Participant
    Master

    in barhunter strategy there’s a code that counts the days when on market, so you can set a limit & exit.

    Midlanddave thanked this post
    #170158 quote
    Albaran
    Participant
    Average

    @Robertogozzi: thanks, I’ll have a look at it!


    @Paul
    : I haven’t seen the piece of code you’re talking of, is it one of the itf files attached? If so, the more basic question is => with what do I open ITF files? I’ve tried File Viewer Plus but doesn’t seem to be working so I’m at a loss…

    #170159 quote
    Paul
    Participant
    Master

    yes it’s inside at the bottom of the itf

    for help you can open a different topic or have a look in the manual.

    #170254 quote
    Albaran
    Participant
    Average

    I read in the manual about DAYS.

    I think that command is enough for what I want to achieve.

    I’ll give it a try and come back to you guys should it prove not to be the case…

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Counter of days


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Albaran @albaran Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by Albaran
4 years, 9 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 05/21/2021
Status: Active
Attachments: No files
Logo Logo
Loading...