linebreak_经典MT4指标3LineBreak

查看原文:http://www.125808047.com/?p=2308

3LineBreak指标用一根线型替代蜡烛。如果需要图表中不显示蜡烛,请选择折线然后图表属性将折线颜色设置为None即可。

3LineBreak指标图表效果如下:

3LineBreak指标MQL4源码如下:

//+------------------------------------------------------------------+

//| 3LineBreak.mq4 |

//| Copyright @ 2004, Poul_Trade_Forum |

//| Aborigen |

//| http://forex.kbpauk.ru/ |

//+------------------------------------------------------------------+

#property copyright "Poul Trade Forum"

#property link "http://forex.kbpauk.ru/"

#property indicator_chart_window

#property indicator_buffers 2

//---- input parameters

extern int Lines_Break=3;

//---- buffers

double HighBuffer[];

double LowBuffer[];

double VALUE1,VALUE2,Swing=1,OLDSwing;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

string short_name;

//---- indicator line

SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,2,Blue);

SetIndexStyle(1,DRAW_HISTOGRAM,EMPTY,2,Red);

SetIndexBuffer(0,HighBuffer);

SetIndexBuffer(1,LowBuffer);

SetIndexEmptyValue(0,0);

SetIndexEmptyValue(1,0);

//---- name for DataWindow and indicator subwindow label

short_name="3LineBreak";

IndicatorShortName(short_name);

SetIndexLabel(0,short_name);

//----

SetIndexDrawBegin(0,10);

SetIndexDrawBegin(1,10);

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custor indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

Comment("www.125808047.com");

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

int counted_bars=IndicatorCounted(),i,shift;

//---- TODO: add your code here

if (counted_bars==0) counted_bars=Lines_Break+1;

i=(Bars-counted_bars);

for (shift=i; shift>=0;shift--)

{

OLDSwing=Swing;

VALUE1=High[Highest(NULL,0,MODE_HIGH,Lines_Break,shift+1)];

VALUE2= Low[Lowest(NULL,0,MODE_LOW,Lines_Break,shift+1)];

if (OLDSwing==1 && Low[shift]

if (OLDSwing==-1 && High[shift]>VALUE1 ) Swing=1;

if (Swing==1)

{ HighBuffer[shift]=High[shift]; LowBuffer[shift]=Low[shift]; }

if (Swing==-1)

{ LowBuffer[shift]=High[shift]; HighBuffer[shift]=Low[shift]; }

//----

}

return(0);

}

//+------------------------------------------------------------------+

[download id="63"]

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
\linebreak命令用于强制换行,与\newline命令相同。它会在当前位置插入一个换行符,使得下一行从新的一行开始。\[1\]这个命令在文本编辑器中常用于在文本中插入换行符。在LaTeX中,\linebreak命令可以用于在公式中插入换行符,以便使公式更易读。\[3\]在某些情况下,\linebreak命令可能无法实现预期的效果,特别是在Windows系统中,因为Windows使用的是CRLF换行符,而不是Unix风格的LF换行符。\[2\]在这种情况下,可以尝试使用其他换行命令,如\\或\newline,或者使用\clearpage命令来分页。\[1\] #### 引用[.reference_title] - *1* *3* [LaTeX使用过程中遇到的几点问题](https://blog.csdn.net/weixin_43698988/article/details/100146198)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [优雅解决:(linebreak-style) Expected linebreaks to be ‘LF‘ but found ‘CRLF‘. (eslint)](https://blog.csdn.net/weixin_43459866/article/details/110791393)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值