请问MC有个pivot reversal的策略能转成金字塔策略么 [金字塔]
- 咨询内容:
1.pivot函数
inputs: PriceValue( numericseries ), Len( numericsimple ), LeftStrength( numericsimple ), RightStrength( numericsimple ), Instance( numericsimple ), HiLo( numericsimple ), oPivotPriceValue( numericref ), oPivotBar( numericref ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ), var3( 0 ), var4( false ), var5( false ) ;
var3 = 0 ;var5 = false ;var1 = RightStrength ; while var1 < Len and var5 = false begin var0 = PriceValue[var1] ; var4 = true ; var2 = var1 + 1 ; while var4 = true and var2 - var1 <= LeftStrength begin condition1 = ( HiLo = 1 and var0 < PriceValue[var2] ) or ( HiLo = -1 and var0 > PriceValue[var2] ) ; if condition1 then var4 = false else var2 = var2 + 1 ; end ; var2 = var1 - 1 ; while var4 = true and var1 - var2 <= RightStrength begin condition1 = ( HiLo = 1 and var0 <= PriceValue[var2] ) or ( HiLo = -1 and var0 >= PriceValue[var2] ) ; if condition1 then var4 = false else var2 = var2 - 1 ; end ; if var4 = true then var3 = var3 + 1 ; if var3 = Instance then var5 = true else var1 = var1 + 1 ; end ;if var5 = true then begin oPivotPriceValue = var0 ; oPivotBar = var1 + ExecOffset ; Pivot = 1 ; endelse begin oPivotPriceValue = -1 ; oPivotBar = -1 ; Pivot = -1 ; end ;
2.swinghigh函数
inputs: Instance( numericsimple ), PriceValue( numericseries ), Strength( numericsimple ), Len( numericsimple ) ;
variables: var0( 0 ), var1( 0 ) ;
Value1 = Pivot( PriceValue, Len, Strength, Strength, Instance, 1, var0, var1 ) ;
SwingHigh = var0 ;
3. 信号
[IntrabarOrderGeneration = false]inputs: Strength( 4 ) ;variables: var0( false ), var1( 0 ) ;
condition1 = SwingHigh( 1, High, Strength, Strength + 1 ) <> -1 ;if condition1 then begin var0 = true ; var1 = High[Strength] ;endelse begin condition1 = var0 and High >= var1 + 1 point ; if condition1 then var0 = false ;end;
if var0 then Buy ( "PivRevLE" ) next bar at var1 + 1 point stop ; - 金字塔客服:
注释下每句话是什么意思
- 用户回复:
每句都要注释?
- 网友回复:
这实际上是一个挺基本的程式
- 网友回复: 一定要注释
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 511411198 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容