金字塔决策交易系统

 找回密码
 

微信登录

微信扫一扫,快速登录

搜索
查看: 2654|回复: 0

菲阿里四价(VBA 版)

[复制链接]

70

主题

190

帖子

275

积分

Rank: 9Rank: 9Rank: 9

等级: 管理员

注册:
2021-5-18
曾用名:
发表于 2021-5-20 15:15 | 显示全部楼层 |阅读模式
//转自旧论坛版主_rushtaotao


// 在此提供个vba交易模板 由菲阿里四价pel版改写过来,希望高手们也可以慷慨提供更多的vba模板 供金字塔用户使用

[Visual Basic] 复制代码
Dim ss
    ss = 1
''''''''''多头止损系数
dim n1
    n1 = 10
'''''''''空头止损系数
dim n2
    n2 = 10
    
'''''''''   
dim n3
    n3 = 4
    
dim LastHigh
dim LastLow
dim LastClose
dim Icode
dim Imarket
sub application_vbastart()
    call MarketData.RegReportNotify("if03","zj")
end sub
'''''''''''''''''''''多头
'BuyHoding=0 and SellHolding=0 and
    if Hour(Time) >09 and Hour(Time) <14 and    NewPrice>LastHigh and BuyHolding = 0 then
       call application.MsgOut("多头开!")
       call order.buy(1,ss,0,0,"if03","zj","",0)
    end if
    if BuyHoding>0 and NewPrice<BuyCost-n1*MinTick and Hour(Time) >09 and Hour(Time) <14 then
       call application.MsgOut("多头止损!")      
       call order.Sell(1,BuyHolding,0,0,"if03","zj","",0)
    end if
    if SellHoding>0 and NewPrice>BuyCost+n2*MinTick and Hour(Time) >09 and Hour(Time) <14 then
       call application.MsgOut("空头开!")   
       call order.SellShort(1,SellHolding,0,0,"if03","zj","",0)
    end if
'''''''''''''''''''''日内平仓
    if Hour(Time) >= 14 and Hour(Time) <=15 then
       call application.MsgOut("收盘全平!")
       call order.Sell(1,BuyHolding,0,0,Icode,Imarket,"",1)
       call order.SellShort(1,SellHolding,0,0,"if03","zj","",1)
    end if
End Sub
 
Sub UserForm1_CommandButton1_Click()
    call application.MsgOut(LastHigh&" "&NewPrice)
金字塔提供一对一VIP专业技术指导服务,技术团队实时响应您的日常使用问题与策略编写。联系电话:021-20339086
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 微信登录

本版积分规则

手机版|小黑屋|上海金之塔信息技术有限公司 ( 沪ICP备13035422号 )

GMT+8, 2024-11-16 04:15 , Processed in 0.309826 second(s), 22 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表