最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

期貨量化交易軟件:交易者的工具箱設(shè)計(jì)指標(biāo)

2023-08-16 17:05 作者:bili_45793681098  | 我要投稿

簡介

什么是指標(biāo)? 指標(biāo)是顯示特定數(shù)據(jù)類型的指定工具。 通常這是關(guān)于價(jià)格系列屬性的信息,赫茲量化正是會對這種指標(biāo)類型做進(jìn)一步的討論。

每個(gè)指標(biāo)還擁有自己的屬性和特性:例如,值的范圍,超買/超賣區(qū)間,交叉線、頂部和底部... 這些大量的屬性可連續(xù)地與主指標(biāo)值共同使用。 但是,這些屬性并不總是有效。 有多種原因 - 指標(biāo)窗口過小,低密度等。

本文目的旨在協(xié)助你改善描述性和信息性的指標(biāo)值,以及促進(jìn)代碼實(shí)施過程的部分自動化和簡易化。 我希望以下的代碼對專業(yè)開發(fā)人員和新手都不會造成困難。

本文主要面向的人群需至少擁有 赫茲量化入門水平知識,可以在代碼中實(shí)施簡單想法和算法,了解終端內(nèi)的代碼存儲架構(gòu),并且可以使用庫(experts/libraries)和頭文件(experts/include)。

編輯切換為居中


1. 設(shè)置一項(xiàng)任務(wù)

所有指標(biāo)中,我想要列出最具信息性的常用指標(biāo):

  • 交叉線。


編輯


  • 水平 - 不僅是交叉點(diǎn)的水平,整個(gè)水平都將高亮。


編輯

  • 頂部/底部為簡單說明。


編輯

  • 上行/下行方向使用不同配色。


編輯

赫茲量化來對其進(jìn)行討論。



2. 基本概念

為避免誤解,赫茲量化花些時(shí)間來查看指標(biāo)架構(gòu)。

#property indicator_separate_window // number of visible buffers of the indicator #property indicator_buffers 3 // setting the range of indicator values #property indicator_minimum 0 #property indicator_maximum 100 // setting indicator colors #property indicator_color1 ?White #property indicator_color2 ?Red #property indicator_color3 ?Blue // external settings extern int RSIPeriod ? ? ? = 9; extern int AppliedPrice ? ?= 0; extern int MAPeriod ? ? ? ?= 5; // declaring indicator buffers. Here they can be declared in any order. // Any names can be given to buffers, though better meaningful double Values[]; ? ? ? ? ? // Values double SmoothedValues[]; ? // Smoothed values double Crosses[]; ? ? ? ? ?// intersections // Significant number of digits after a decimal point in indicator values int DigitsUsed = 5; // Used empty value. In MQL4 there are two empty values -- EMPTY (-1) // -- used as an empty parameter when calling functions // EMPTY_VALUE (0x7FFFFFFF) -- used as an unacceptable value // (or default value) of a variable in indicators and function calls. // The fact is, most built-in indicators return 0 if there is no value // Besides, in custom (iCustom) indicators the empty value can be // set as any, this must be noted. int EmptyValueUsed = 0; // Initialization function. int init() { ? // Number of used buffers can be larger than that of displayed ones; some ? // may contain intermediate calculations and additional information. The total ? // number of buffers including additional ones is displayed here. ? // If there are no additional buffers, ? // this line is not needed. Total number must not exceed 8 ? // IndicatorBuffers(3); ? // associate buffers. Indexes must go from 0 till the declared number (not including) ? // buffers are drawn in the order of index growing, this is important and can be ? // used when righting indicators further. ? // It means that a buffer with a larger index is drawn above the buffer with lower one ? SetIndexBuffer(0, Values); ? SetIndexBuffer(1, SmoothedValues); ? SetIndexBuffer(2, Crosses); ? // besides, it is important that additional buffers are located after displayed ones ? // (i.e. they must have higher index) otherwise problems may occur displaying buffers, ? // and sometimes the error can be hardly found ? // This function sets an empty value for the buffer with the preset index ? // I do not recommend to use this function in order to avoid possible difficulties ? // Default empty value for buffers -- EMPTY_VALUE. ? // Empty buffer values are not drawn in a chart (except for DRAW_ZIGZAG) ? // SetIndexEmptyValue(0, EMPTY_VALUE); ? ? // Set parameters for buffers ? SetIndexStyle(0, DRAW_LINE); ? ? // The main signal is a solid line ? SetIndexStyle(1, DRAW_LINE, STYLE_DASH); // Smoothed -- dotted line ? SetIndexStyle(2, DRAW_ARROW, STYLE_SOLID, 2); // Intersections -- crosses of the size 2 ? ? SetIndexArrow(2, 251); // cross code in Wingdings ? ? IndicatorDigits(DigitsUsed); // set number of significant digits after point ? ? // Setting the starting plotting point for each indicator. If in terms of the current index ? // the history depth ? // is lower than the value written here, the buffer value with this index will not be drawn. ? SetIndexDrawBegin(0, RSIPeriod); ? SetIndexDrawBegin(1, RSIPeriod + MAPeriod); ? SetIndexDrawBegin(2, RSIPeriod + MAPeriod + 1); ? return(0); } int start() { ? // counting number of bars for re-calculation ? int toCount = Bars - IndicatorCounted(); ? ? ? // Calculating values ? // counting from history start till the current moment ? for (int i = toCount - 1; i >=0; i--) ? { ? ? ?// I understood its convenience only when I started to use it ? ? ?// I recommend to conduct the normalization of data at once, ? ? ?// so that later comparison could be easily made ? ? ?Values[i] = NormalizeDouble(iRSI(Symbol(), 0, RSIPeriod, AppliedPrice, i), DigitsUsed); ? } ? ? ? ? // Counting smoothed values ? for (i = toCount - 1; i >=0; i--) ? { ? ? ?SmoothedValues[i] = NormalizeDouble(iMAOnArray(Values, 0, MAPeriod, 0, MODE_EMA, i), DigitsUsed); ? } ? ? ? ? // ... ? ? return(0); }


期貨量化交易軟件:交易者的工具箱設(shè)計(jì)指標(biāo)的評論 (共 條)

分享到微博請遵守國家法律
岳普湖县| 文昌市| 中江县| 桃园市| 宣汉县| 福清市| 安化县| 沅江市| 会东县| 乐山市| 沁源县| 淮北市| 奇台县| 金川县| 南安市| 星座| 滁州市| 万全县| 黄冈市| 平罗县| 孟津县| 吴桥县| 清水河县| 托克托县| 峡江县| 郓城县| 苗栗县| 阆中市| 花莲县| 建湖县| 城口县| 盈江县| 丰台区| 盘锦市| 繁昌县| 友谊县| 龙口市| 荥阳市| 常德市| 罗山县| 响水县|