当前位置:网站首页>Pine脚本 | 如何显示和排版绘图开关?
Pine脚本 | 如何显示和排版绘图开关?
2022-08-04 02:20:00 【奇迹虎虎】
想必白嫖党们和我一样喜欢把一堆代码塞进一个脚本里,但却出现一个痛点,你的绘图开关一大堆,你得在窗口滑来滑去点击。嘿嘿,小虎教你怎么解决“开关的排版问题” ~
先上图,这是最终效果:

代码案例:
- 上图的绘图开关源代码:
//@version=5 indicator(title='top', overlay=true, explicit_plot_zorder=true) //explicit_plot_zorder开启绘制顺序为越靠尾的代码绘图越靠顶 //---------------------------------------------------------------------all_signals--------------------------------------------------------------------- //信号显示模块 head_sma_envelopes_0_signal = input.bool(defval=true, title='HS', inline='head_sma_envelopes_signals_1', group='all_signals') head_sma_timeframe = input.timeframe(defval='W', title='', options=['','D','W','M'], inline='head_sma_envelopes_signals_1', group='all_signals') head_sma_atr_signal = input.bool(defval=true, title='atr', inline='head_sma_envelopes_signals_1', group='all_signals') head_sma_table_signal = input.bool(defval=true, title='table', inline='head_sma_envelopes_signals_1', group='all_signals') head_sma_envelopes_1_signal = input.bool(defval=true, title='HS1', inline='head_sma_envelopes_signals_2', group='all_signals') head_sma_upper_mult = input.float(defval=1.62, title='', step=0.01, inline='head_sma_envelopes_signals_2', group='all_signals') head_sma_envelopes_2_signal = input.bool(defval=true, title='HS2', inline='head_sma_envelopes_signals_2', group='all_signals') head_sma_lower_mult = input.float(defval=0.62, title='', step=0.01, inline='head_sma_envelopes_signals_2', group='all_signals') envelope_signal = input.bool(defval=true, title='envelopes', inline='envelope_signal', group='all_signals') envelope_fill_signal = input.bool(defval=true, title='fill', inline='envelope_signal', group='all_signals') middle_signal = input.bool(defval=true, title='middle', inline='envelope_signal', group='all_signals') SuperTrend_signal = input.bool(defval=true, title='atr1', inline='SuperTrend_signal', group='all_signals') SuperTrend_timeframe = input.timeframe(defval='', title='', options=['','180','D','8D','64D'], inline='SuperTrend_signal', group='all_signals') SuperTrend_signal_2 = input.bool(defval=true, title='atr2', inline='SuperTrend_signal', group='all_signals') SuperTrend_timeframe_2 = input.timeframe(defval='', title='', options=['','180','D','8D','64D'], inline='SuperTrend_signal', group='all_signals') SuperTrend_resistance_signal = input.bool(defval=true, title='SuperTrend Resistance', inline='SuperTrend Resistance', group='all_signals') resistance_signal = input.bool(defval=true, title='resistance', inline='resistance_signal', group='all_signals') td_signal = input.bool(defval=true, title='td', inline='td_signal', group='all_signals') - explicit_plot_zorder=true,这个设置能让你代码中的 plot 输出的绘图按代码顺序倒序绘制,建议开启。当然不开也可以,但在绘图过多的情况下,你的绘图顺序可能会一团糟。
- inline='head_sma_envelopes_signals_1' ,inline 的功能使 input 放在同一行显示并按代码顺序中从左到右排列。
- group='all_signals',group 的功能是使 input 分组显示,相当于word文档的段落间距。
排版技巧:
- 先确定相关性,把相关的开关划分为一组
- 再确定重要性,从上到下排序
- 开关名称尽量简写
- 适当使用option下拉列表替代bool勾选开关,有助于节省弹窗空间
边栏推荐
- 小甲鱼汇编笔记
- 2022年茶艺师(中级)考试试题模拟考试平台操作
- Flink jdbc connector 源码改造sink之 clickhouse多节点轮询写与性能分析
- Continuing to invest in product research and development, Dingdong Maicai wins in supply chain investment
- 织梦响应式酒店民宿住宿类网站织梦模板(自适应手机端)
- QNX Hypervisor 2.2用户手册]10.1 通用vdev选项
- C program compilation and predefined detailed explanation
- FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
- Dong mingzhu live cold face away, when employees frequency low-level mistakes, no one can understand their products
- [QNX Hypervisor 2.2 User Manual] 10.3 vdev gic
猜你喜欢

IDEA02:配置SQL Server2019数据库

C program compilation and predefined detailed explanation

MallBook 助力SKT思珂特教育集团,立足变化,拥抱敏捷交易

持续投入商品研发,叮咚买菜赢在了供应链投入上

mpf5_定价Bond_yield curve_Spot coupon_duration_有效利率_连续复利_远期_Vasicek短期_CIR模型Derivatives_Tridiagonal_ppf

关联接口测试

HBuilderX的下载安装和创建/运行项目

脚手架内容详解分析

共n级台阶,每次可以上1级或2级台阶,有多少种上法?

工程制图平面投影练习
随机推荐
Example 035: Setting the output color
Flask框架初学-05-命令管理Manager及数据库的使用
FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
flask框架初学-06-对数据库的增删改查
Countdown to 2 days, the "New Infrastructure of Cultural Digital Strategy and Ecological Construction of Cultural Art Chain" will kick off soon
天地图坐标系转高德坐标系 WGS84转GCJ02
C# 构造函数业务场景测试项目
实例035:设置输出颜色
脚手架内容详解分析
The idea of the diagram
Example 037: Sorting
Flask Framework Beginner-06-Add, Delete, Modify and Check the Database
esp32 releases robot battery voltage to ros2 (micro-ros+CoCube)
html select tag assignment database query result
在Activity中获取另一个XML文件的控件
Qt中对象树的机制介绍以及底层实现,各种结果分析:(以及自己写容易犯错的点)
Example 040: Reverse List
priority_queue元素为指针时,重载运算符失效
sudo 权限控制,简易
Hey, I had another fight with HR in the small group!