COCO研究院

 找回密碼
 註冊
搜索
查看: 1598|回復: 8

那位大大有AmiBroker显示K线剩余时间的代码?

[複製鏈接]
發表於 14-9-30 09:25 | 顯示全部樓層 |閱讀模式
那位大大有AmiBroker显示K线剩余时间的代码? 谢谢!
發表於 14-9-30 09:46 | 顯示全部樓層
看看這個可以嗎

_SECTION_BEGIN("Time Left");function GetSecondNum(){Time = Now( 4 );Seconds = int( Time % 100 );Minutes = int( Time / 100 % 100 );Hours = int( Time / 10000 % 100 );SecondNum = int( Hours * 60 * 60 + Minutes * 60 + Seconds );return SecondNum;}RequestTimedRefresh( 1 );TimeFrame = Interval();SecNumber = GetSecondNum();Newperiod = SecNumber % TimeFrame == 0;SecsLeft = SecNumber - int( SecNumber / TimeFrame ) * TimeFrame;SecsToGo = TimeFrame - SecsLeft;x=Param("xposn",300,0,1000,1);y=Param("yposn",50,0,1000,1);GfxSelectSolidBrush( ColorRGB( 230, 230, 230 ) );GfxSelectPen( ColorRGB( 230, 230, 230 ), 2 );if ( NewPeriod ){GfxSelectSolidBrush( colorYellow );GfxSelectPen( colorYellow, 2 );Say( "New period" );}GfxRoundRect( x+45, y+17, x-3, y-2, 0, 0 );GfxSetBkMode(1);GfxSelectFont( "Arial", 12, 700, False );GfxSetTextColor( colorBlack );GfxTextOut( ""+SecsToGo+" / "+NumToStr( TimeFrame, 1.0 ), x, y );_SECTION_END();

評分

參與人數 1金錢 +1 收起 理由
keymaker + 1 感謝分享

查看全部評分

發表於 14-9-30 10:32 | 顯示全部樓層
感謝分享............................................
 樓主| 發表於 14-9-30 11:04 | 顯示全部樓層
谢谢                          版主大大!
 樓主| 發表於 14-10-1 10:26 | 顯示全部樓層
版主大大能修改成   『小时:分:秒』   的格式吗?谢谢!
發表於 14-10-1 22:44 | 顯示全部樓層
vcqcjv 發表於 14-10-1 10:26
版主大大能修改成   『小时:分:秒』   的格式吗?谢谢!

試試看這個吧
_SECTION_BEGIN("Time Left");
tempnum = Now( 4 ) - TimeNum();
TimeRem = Interval() - ((int(tempnum[BarCount - 1] / 100) * 60) + (tempnum[BarCount - 1] - int(tempnum[BarCount - 1] / 100) * 100));
if (TimeRem[BarCount - 1] < 0) TimeRem = 0;
MinuteVar = int(TimeRem / 60);
SecondsVar = int(frac(TimeRem / 60) * 60);
TitleTimeRem = EncodeColor(colorWhite) + MinuteVar + ":" + WriteIf(SecondsVar > 9, "", "0") +  SecondsVar;
Hora=Param("Horizontal Positiona",525,1,1200,1);
Vera=Param("Vertical Positiona",17,1,830,1);
GfxSetBkMode( colorWhite );
FST=Param("Font Size Time",12,11,100,1);
GfxSelectFont( "Arial", FST, 700, italic = False, underline = False, True );
GfxSetTextColor(ParamColor("Color",colorWhite) );
GfxTextOut( ""+MinuteVar+":"+WriteIf(SecondsVar > 9, "","0")+SecondsVar+"", Hora+30 , Vera+65 );
_SECTION_END();




不過"小時"沒辦法倒數

我不會
 樓主| 發表於 14-10-2 08:59 | 顯示全部樓層
谢谢版主大大    这个不会动  显示0:00
發表於 14-10-2 09:06 | 顯示全部樓層
vcqcjv 發表於 14-10-2 08:59
谢谢版主大大    这个不会动  显示0:00

只能用分(鐘)線才會動
 樓主| 發表於 14-10-3 06:57 | 顯示全部樓層
谢谢                 版主大大
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-4-27 10:52

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook