欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件策略编写求助区 → 海龟经典软件-TRADING BLOX策略

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有12092人关注过本帖平板打印复制链接

主题:海龟经典软件-TRADING BLOX策略

帅哥哟,离线,有人找我吗?
solarhe2006
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游侠 帖子:252 积分:1001 威望:0 精华:0 注册:2010/2/15 16:47:58
海龟经典软件-TRADING BLOX策略  发帖心情 Post By:2011/3/30 21:35:19 [只看该作者]

 

Exit Orders;

VARIABLES: brokerPrice, exitPrice, unitCurrentStopPrice TYPE: Price

VARIABLES: unitsOn, unitIndex TYPE: Integer

 

unitsOn = instrument.totalUnits

 

' If long...

IF ( instrument.position = LONG ) THEN

 

    ' Get the best exit price based on exit low and entry low.

    exitPrice = max( offsetAdjustedExitLow, offsetAdjustedEntryLow )

    

    ' Loop over the units and place stop order at the best price,

    ' including current stop price.

    FOR unitIndex = 1 TO unitsOn

        unitCurrentStopPrice = instrument.unitExitStop[ unitIndex ]

        brokerPrice = max( exitPrice, unitCurrentStopPrice )

        broker.ExitUnitOnStop( unitIndex, brokerPrice )

    NEXT

ENDIF

 

' If short...

IF ( instrument.position = SHORT ) THEN

 

    ' Get the best exit price based on exit high and entry high.

    exitPrice = min( offsetAdjustedExitHigh, offsetAdjustedEntryHigh )

    

    'Loop over units and place stop order at best price,

    ' including curreen stop price.

    FOR unitIndex = 1 TO unitsOn

        unitCurrentStopPrice = instrument.unitExitStop[ unitIndex ]

        brokerPrice = min( exitPrice, unitCurrentStopPrice )

        broker.ExitUnitOnStop( unitIndex, brokerPrice )

    NEXT

ENDIF

 

 

Adjust Stops:

VARIABLES: stopPrice, bestExitPrice, unitCurrentStopPrice TYPE: Price

VARIABLES: unitsOn, unitIndex TYPE: Integer

 

' Get the total units on.

unitsOn = instrument.totalUnits

 

' If long...

IF ( instrument.position = LONG ) THEN

 

    ' Get the best exit price based on exit low and entry low.

    bestExitPrice = max( offsetAdjustedExitLow, offsetAdjustedEntryLow )

    

    ' Loop over the units and set the stop to the best price,

    ' including current stop price.

    FOR unitIndex = 1 TO unitsOn

    

        ' Get the current exit stop.

        unitCurrentStopPrice = instrument.unitExitStop[ unitIndex ]

        

        ' If the best stop is better than our current stop then

        ' exit on this stop.

        IF bestExitPrice > unitCurrentStopPrice THEN

            instrument.SetExitStop( unitIndex, bestExitPrice )

            broker.exitUnitOnStop( unitIndex, bestExitPrice )

        ENDIF

    NEXT

ENDIF

 

' If short...

IF ( instrument.position = SHORT ) THEN

 

    ' Get the best exit price based on exit high and entry high.

    bestExitPrice = min( offsetAdjustedExitHigh, offsetAdjustedEntryHigh )

    

    ' Loop over the units and set the stop to the best price,

    ' including curreen stop price.

    FOR unitIndex = 1 TO unitsOn

    

        ' Get the current exit stop.

        unitCurrentStopPrice = instrument.unitExitStop[ unitIndex ]

        

        ' If the best stop is better than our current stop then

        ' exit on this stop.

        IF bestExitPrice < unitCurrentStopPrice THEN

            instrument.SetExitStop( unitIndex, bestExitPrice )

            broker.exitUnitOnStop( unitIndex, bestExitPrice )

        ENDIF

    NEXT

ENDIF


 回到顶部
总数 11 1 2 下一页