当前位置:网站首页>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勾选开关,有助于节省弹窗空间
边栏推荐
- pytorch applied to MNIST handwritten font recognition
- 浏览器存储
- In a more general sense, calculating the displacement distance and assumptions
- What is the source of flinkcdc consuming mysql binlog data without sqltype=delete
- ssh服务详解
- [QNX Hypervisor 2.2用户手册]10.3 vdev gic
- 【学习笔记之菜Dog学C】动态内存管理
- 第13章 网络安全漏洞防护技术原理与应用
- 实例038:矩阵对角线之和
- Example 040: Reverse List
猜你喜欢

Example 040: Reverse List

There are n steps in total, and you can go up to 1 or 2 steps each time. How many ways are there?

倒计时2天,“文化数字化战略新型基础设施暨文化艺术链生态建设发布会”启幕在即

Parquet encoding

priority_queue元素为指针时,重载运算符失效

安全至上:落地DevSecOps最佳实践你不得不知道的工具

DDTL: Domain Transfer Learning at a Distance

activiti流程执行过程中,数据库表的使用关系

Zabbix设置邮件告警+企业微信告警

Download install and create/run project for HBuilderX
随机推荐
Flask框架初学-05-命令管理Manager及数据库的使用
Multithreading JUC Learning Chapter 1 Steps to Create Multithreading
安全至上:落地DevSecOps最佳实践你不得不知道的工具
FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
The browser
Example: 036 is a prime number
深度学习(三)分类 理论部分
DDTL: Domain Transfer Learning at a Distance
esp32发布机器人电池电压到ros2(micro-ros+CoCube)
Example 040: Reverse List
MallBook联合人民交通出版社,推动驾培领域新发展,开启驾培智慧交易新生态
MySQL高级-读写分离-分库分表
v-model
瑞能微计量芯片RN2026的实用程序
简单排序(暑假每日一题 14)
计算首屏时间
工程制图复习题(带答案)
Taurus.MVC WebAPI 入门开发教程1:框架下载环境配置与运行(含系列目录)。
[QNX Hypervisor 2.2用户手册]10.3 vdev gic
SAP SD模块前台操作