Can you display a countdown timer or T&S in Multicharts?

Discussion in 'Trading Software' started by forrestang, Feb 12, 2009.

  1. A countdown timer would be nice, like on most other platforms. So you have an idea of how many shares are need to complete a bar.

    Time and Sales as well?
     
  2. karsat

    karsat

    There is no T&S in Multicharts...
     
  3. tomu

    tomu

    I don't understand what you are talking about? What do you mean by bar?
     
  4. Like if you were looking at a share bar chart, where if you set it to 1000, it plots a bar every time 1000 contracts are traded.

    Same for ticks with number of TRADES taken.

    If you're on a time graph, it will countdown the amount of time left before a new bar starts printing.
     
  5. Hi forrestang,

    Volume countdown can be easily coded in MultiCharts. Moreover, if I am not mistaken our customers have already written one. If you are a registered MC user, you can log into our forum and search for one or contact us for this study.

    Regards.
     
  6. Andrew, i tried to register on that forum a long time ago, and could never do it. It's like there is no link to attempt to register.

    I did find the thread that was for the countdown timer, but I can't view any of the code if it was there.

    Can you post or attach the files for the countdown timer?
     
  7. Aok

    Aok

    Copy and paste Forrest.

    *******************************

    [LegacyColorValue = true];


    { WAV_MinTimer Indicator WAV 7/19/04

    for intra-day, time-based charts only

    Borrows some from eKam Timer (thanks)..

    uses BarStatus to read time at end of bar
    and reset params

    once-a-bar alert

    7/21/04
    slight mod to alert for 1st bar of day

    7/26/04
    slight mods to allow for text position to right
    best to use HOffset = 0 and at least 6 bars to the right
    ok with regular bar types...but not for Heikin Ashi bars (yet)

    uses GetTickValue function

    7/27/04
    added PostText string input ...added after number of seconds left
    8/11/04
    changed time format...now shows minutes:seconds
    now has better horiz offset ... can move further to right of last bar
    (use negative HOffset for this)

    }
    inputs: Hspacer(10),Vspacer(80),AlertSecs(25),TextColor(magenta),
    AlertColor(yellow),soundoff(false);

    vars: txt(-1),str(""),SecsLeft(0),value2(0),ref(0),spacer(""),
    StartTime(0),IntervalSecs(0),n(0),
    EndTime(0), TextID(-1),AlertTime(0);

    if BarNumber = 1 then begin
    TextId = Text_New( date, time, 0, "." );
    value2= text_new(date,time,close," ");
    Text_SetColor(value2,Textcolor); Text_setStyle(value2,2,0);
    for n= 1 to Hspacer begin
    spacer=spacer+" ";
    end;
    end;

    if LastBarOnChart and BarType = 1 then
    begin
    //set BarInterval time to seconds
    IntervalSecs = BarInterval*60;
    //Barstatus: 0=opening tick...2=closing tick...1=other tick
    if BarStatus(1) = 2 then //closing tick ...so reset params and draw new text
    begin
    //convert fraction portion of time to seconds ...(from days to seconds)
    StartTime = FracPortion(ComputerDateTime)*86400; //24*60*60
    //calc when time is up
    EndTime = StartTime + IntervalSecs;//calc time when bar should be done
    //make string to output
    value1 = SecsLeft / 60;//minutes
    str = NumToStr(IntPortion(value1),0)+":";
    value1 = SecsLeft - 60*IntPortion(value1);
    str = str + NumToStr(value1,0);

    ref = text_SetVertLocation(value2,Vspacer);
    ref = text_SetString(value2,str+spacer);

    //delete old txt
    {
    if txt > 0 then
    text_Delete(txt);

    if HOffset <= 0 then
    begin
    //move text to right of last bar
    txt = text_new(date,Calctime( Time, -HOffset*BarInterval),
    high + GetTickValue,str);
    text_SetStyle(txt,0,1);//set right and top
    end else
    begin
    //text to left of last bar
    txt = text_new(date[HOffset],Time[HOffset],
    high + GetTickValue,str);
    text_SetStyle(txt,1,2);
    end;
    text_SetColor(txt,TextColor);
    }
    end;

    //get time at new tick
    if BarStatus(1) = 1 and EndTime > 0 then
    begin
    //calc seconds remaining
    SecsLeft = EndTime - FracPortion(ComputerDateTime)*86400;
    //update text
    if SecsLeft >= 0 then
    begin
    value1 = SecsLeft / 60;//minutes
    str = NumToStr(IntPortion(value1),0)+":";
    value1 = SecsLeft - 60*IntPortion(value1);
    str = str + NumToStr(value1,0);
    ref = text_SetVertLocation(value2,Vspacer);
    ref = text_SetString(value2,str+spacer);

    {
    //str = " "+NumToStr(SecsLeft,0)+PostText;
    text_SetString(txt,str);
    //have text move with price...if using HOffset = 0
    if HOffset <= 0 then
    begin
    if close < open then
    text_SetLocation(txt,date,Calctime( Time, -HOffset*BarInterval),
    high + GetTickValue)
    else
    text_SetLocation(txt,date,Calctime( Time, -HOffset*BarInterval),
    low - GetTickValue);
    end;
    }
    end;
    //see if time for alert
    //be sure SecsLeft not a huge negative number on 1st bar of day
    if SecsLeft <= AlertSecs and SecsLeft >= 0 and soundoff=true then
    begin
    text_SetColor(value2,AlertColor);
    AlertTime = text_GetTime(TextID);
    if AlertTime <> time then
    begin
    alert(NumToStr(SecsLeft,0) + " seconds");
    text_SetLocation(TextID,date,time,0);
    end;
    end;
    end;
    end;


    *****************************

    Enjoy
     
  8. Aok

    Aok

    One more thing. When you add the Timer dont freak out when you dont see it right away.

    It needs to finish whatever X frame youre looking at before it starts. So if you put it on 1 min chart, it will start countdown on the NEXT min bar. 5 min takes whatever interval of 5 min left to see, 10, 15 so on and so on.

    Good luck.
     
  9. Where is this pasted?
     
  10. Paste the attached in the Power Editor, compile, then add to your chart. This should work for tick and volume charts.

    TG
     
    #10     Feb 17, 2009