: | : | :期货程序化 | :期货程序化研究 | :期货量化学习 | :期货量化 |
返回列表 发帖

[MC源码] multicharts关键词GetAppInfo

[MC源码] multicharts关键词GetAppInfo

本帖隐藏的内容需要回复才可以浏览

论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
 
期货论坛 - 版权/免责声明   1.本站发布源码(包括函数、指标、策略等)均属开放源码,用意在于让使用者学习程序化语法撰写,使用者可以任意修改语法內容并调整参数。仅限用于个人学习使用,请勿转载、滥用,严禁私自连接实盘账户交易
  2.本站发布资讯(包括文章、视频、历史记录、教材、评论、资讯、交易方案等)均系转载自网络主流媒体,内容仅为作者当日个人观点,本网转载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。本网不对该类信息或数据做任何保证。不对您构成任何投资建议,不能依靠信息而取代自身独立判断,不对因使用本篇文章所诉信息或观点等导致的损失承担任何责任。
  3.本站发布资源(包括书籍、杂志、文档、软件等)均从互联网搜索而来,仅供个人免费交流学习,不可用作商业用途,本站不对显示的内容承担任何责任。请在下载后24小时内删除。如果喜欢,请购买正版,谢谢合作!
  4.龙听期货论坛原创文章属本网版权作品,转载须注明来源“龙听期货论坛”,违者本网将保留追究其相关法律责任的权力。本论坛除发布原创文章外,亦致力于优秀财经文章的交流分享,部分文章推送时若未能及时与原作者取得联系并涉及版权问题时,请及时联系删除。联系方式:http://www.qhlt.cn/thread-262-1-1.html
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

  1. GetAppInfo(aiBarSpacing)
复制代码


—— 返回目前图表上的K棒宽度
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

TOP

  1. GetAppInfo(aiCalcReason)
复制代码

返回重新计算的原因 。

GetAppInfo返回初始化计算的原因:

            0   (CalcReason_default) - 默认当新的bar/tick出现时,计算会初始化

            1   (CalcReason_mouseLClick) - 鼠标在图表上左击后,计算会初始化

            2   (CalcReason_mouseRClick) - 鼠标在图表上右击后,计算会初始化

            3   (CalcReason_timer) - 在RecalcLastBarAfter期限超时后,计算会初始化

            4   (CalcReason_MPChange) - 在商品的图表部位即marketposition变动后,计算会初始化

            5   (CalcReason_OrderFilled) - 在委托单成交后,计算会初始化(仅用于信号)
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

TOP

RecalcLastBarAfter

超过指定时间,则初始化计算。指定时间为秒。


用法
RecalcLastBarAfter(Timeout)
参数说明: Timeout —— 秒数 (时间)


范例
RecalcLastBarAfter(60) 自上次计算后如果超时1分钟的话,则启动新的脚本计算。
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

TOP

实例:
  1. switch (getappinfo(aicalcreason)) begin
  2.     case CalcReason_MouseLClick : if MouseClickCtrlPressed then begin
  3.     var: var0(0), var1(0);
  4.         repeat
  5.             if 0 = var0 then begin
  6.             var0 = MouseClickDateTime;
  7.             break;
  8.             end;
  9.         until(false);
  10.     end;
  11. end;
  12. var1 = datetime2eltime(var0);
  13. print("Time of the Bar = ", var1);
复制代码



Will return the time of the bar after left click on it pressing Ctrl button on the keyboard.左键单击键盘上的Ctrl按钮后,将返回该条的时间。
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

TOP

实例:
Using GetAppInfo for Chart Window information
The example below uses the Print keyword to print information about the current Chart Window to the PowerLanguage Editor output log:


  1. // Example: Getting data about the chart window using GetAppInfo       
  2. if LastBarOnChart_s = True then begin

  3.         Print("The leftmost date on this chart is ", FormatDate("MM/dd/yyyy", GetAppInfo(aiLeftDispDateTime)),
  4.                 ", and the rightmost date on this chart is ", FormatDate("MM/dd/yyyy", GetAppInfo(aiRightDispDateTime)));
  5.                
  6.         Print(NewLine,
  7.                 "The leftmost bar closes at ", FormatTime("HH:mm:ss", GetAppInfo(aiLeftDispDateTime)),
  8.                 " and the rightmost bar closes at ", FormatTime("HH:mm:ss", GetAppInfo(aiRightDispDateTime)) );
  9.                
  10.         Print(NewLine,
  11.                 "The highest price on the Y axis (price scale) is ", NumToStr( GetAppInfo(aiHighestDispValue), 0),
  12.                 " and the lowest price on the same axis is ", NumToStr( GetAppInfo(aiLowestDispValue), 0));

  13. end;
复制代码



This would give an output similar to:


  1. The leftmost date on this chart is 01/20/2012, and the rightmost date on this chart is 01/20/2012

  2. The leftmost bar closes at 12:31:16 and the rightmost bar closes at 21:56:15

  3. The highest price on the Y axis (price scale) is 2438 and the lowest price on the same axis is 2411
复制代码
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

TOP

实例:
使用GetAppInfo监视ATS
在下面的简化示例中,GetAppInfo(aiStrategyAuto)用于监视自动交易策略的状态。如果ATS关闭,则会发出声音警报。


  1. //                Strategy that gets turned off.

  2. Variables:
  3.    IntraBarPersist PrevATSStatus(0),           // Holds the status of the ATS at the previous update
  4.    atsStatus(0);                                                // Holds the current ATS status

  5. if (LastBarOnChart_s = True) then begin

  6.    atsStatus    = GetAppInfo(aiStrategyAuto);
  7.    
  8.    // If the current ATS Status is different from the previous, and the previous
  9.    //      status was ON, give an sound alert.
  10.    if (atsStatus <> PrevATSStatus) and (PrevATSStatus = 1) then begin
  11.    
  12.                 PlaySound("C:\Temp\atsTurnedOff.wav");

  13.    end;

  14.    PrevATSStatus    = atsStatus;

  15.    RecalcLastBarAfter(15);        // Update every 15 seconds, even if the data feed stops updating
  16.    
  17. end;
复制代码
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

TOP

返回列表