請問MC有個pivot reversal的策略能轉成金字塔策略么
作者:金字塔 來源:cxh99.com 發布時間:2016年02月29日
- 咨詢內容:
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 ;
- 金字塔客服:
注釋下每句話是什么意思
- 用戶回復:
每句都要注釋?
- 網友回復:
這實際上是一個挺基本的程式
- 網友回復:
一定要注釋