关闭的问题,请帮助 - 页 6 123456789 新评论 AIRAT SAFIN 2010.03.18 10:34 #51 ////////////////////////////////////////////////////////////////////< 1> // < Program : Property > //< > // #define 1 " " //< > // #define 2 " " //< > // </Program : Property > //< > // //< > // //< > // < Program : Content > //< > // //< > // < Structure 15 elements in 3 domains > //< > // < 1. Data 7 elements in 1 domains /> //< > // < 2. Code 8 elements in 2 domains /> //< > // </Structure 15 elements in 3 domains > //< > // //< > // < 1. Data 7 = 4 i 3 d - s > //< > // < 1.1. Input 7 = 4 i 3 d - s /> //< > // </1. Data 7 = 4 i 3 d - s > //< > // //< > // < 2. Code 8 / - i 77 l 3 o > //< > // < 2.1. Interface 5 / - i 66 l 3 o /> //< > // < 2.2. Special 3 / - i 11 l - o /> //< > // </2. Code 8 / - i 77 l 3 o > //< > // //< > // </Program : Content > //< > ////////////////////////////////////////////////////////////////////< 2> // < 1.1. Data : Input > //< > // //< > // < 1.1. Input 7 = 4 i 3 d - s > //< > // < 1. Strategy 4 = 2 i 2 d - s /> //< > // < 2. Trading 3 = 2 i 1 d - s /> //< > // </1.1. Input 7 = 4 i 3 d - s > //< > // //< > // < 1. Strategy 4 >=========================================//< > int iBaseLag = 20 ; //< > int iBaseBar = 1 ; //< > double dFactorTP = 1.0 ; //< > double dFactorSL = 2.0 ; //< > // </ 1. Strategy 4 >=========================================//< > // //< > // < 2. Trading 3 >==========================================//< > int iSlippage = 1 ; //< > int iMagic = 1 ; //< > double dLots = 0.1 ; //< > // </ 2. Trading 3 >==========================================//< > // //< > // //< > // //< > // </1.1. Data : Input > //< > AIRAT SAFIN 2010.03.18 10:35 #52 ////////////////////////////////////////////////////////////////////< 3> // < 2.1. Code : Interface > //< > // //< > // < 2.1. Interface 5 / - i 66 l 3 o > //< > // < 1. iSignalOpen - i 14 l 1 o /> //< > // < 2. iSignalClose - i 15 l 1 o /> //< > // < 3. iGetTicket - i 7 l 1 o /> //< > // < 4. iTryOpen - i 15 l - o /> //< > // < 5. iTryClose - i 15 l - o /> //< > // </2.1. Interface 5 / - i 66 l 3 o > //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // </2.1. Code : Interface > //< > ////////////////////////////////////////////////////////////////////< 4> // < 2.1.1. Code : Interface : iSignalOpen > //< > int iSignalOpen () // - i 14 l 1 o //< > { //< > static int iTime_0 = EMPTY ; //< > if ( iTime_0 < iTime ( 0 , 0 , 0 ) ) //< > { iTime_0 = iTime ( 0 , 0 , 0 ) ; //< > static double dHighest , dLowest ; //< > // //< > dHighest = High [ iHighest ( 0 , 0 , MODE_HIGH , //< > iBaseLag , iBaseBar ) ] ; //< > // //< > dLowest = Low [ iLowest ( 0 , 0 , MODE_LOW , //< > iBaseLag , iBaseBar ) ] ; //< > } // if //< > // //< > double dAsk = MarketInfo ( Symbol () , MODE_ASK ) ; //< > double dBid = MarketInfo ( Symbol () , MODE_BID ) ; //< > // //< > if ( dAsk > dHighest ) return ( OP_BUY ) ; //< > if ( dBid < dLowest ) return ( OP_SELL ) ; //< > return ( EMPTY ) ; //< > } //< > // </2.1.1. Code : Interface : iSignalOpen > //< > AIRAT SAFIN 2010.03.18 10:35 #53 ////////////////////////////////////////////////////////////////////< 5> // < 2.1.2. Code : Interface : iSignalClose > //< > int iSignalClose () // - i 15 l 1 o //< > { //< > static int iTime_0 = EMPTY ; //< > if ( iTime_0 < iTime ( 0 , 0 , 0 ) ) //< > { iTime_0 = iTime ( 0 , 0 , 0 ) ; //< > static double dATR , dProfit , dLoss ; //< > dATR = iATR ( 0 , 0 , iBaseLag , iBaseBar ) ; //< > } // if //< > // //< > double dDelta = OrderOpenPrice () - OrderClosePrice () ; //< > // //< > if ( OrderType () == OP_BUY ) //< > { dProfit = -dDelta ; dLoss = dDelta ; } //< > else if ( OrderType () == OP_SELL ) //< > { dProfit = dDelta ; dLoss = -dDelta ; } //< > else return ( EMPTY ) ; //< > // //< > if ( dProfit > dATR * dFactorTP ) return ( TRUE ) ; //< > if ( dLoss > dATR * dFactorSL ) return ( TRUE ) ; //< > return ( EMPTY ) ; //< > } //< > // </2.1.2. Code : Interface : iSignalClose > //< > ////////////////////////////////////////////////////////////////////< 6> // < 2.1.3. Code : Interface : iGetTicket > //< > int iGetTicket () // - i 7 l 1 o //< > { //< > for ( int i = OrdersTotal () - 1 ; i >= 0 ; i -- ) //< > { //< > if ( OrderSelect ( i , SELECT_BY_POS ) == TRUE ) //< > if ( OrderMagicNumber () == iMagic ) //< > return ( OrderTicket () ) ; //< > } // for //< > return ( EMPTY ) ; //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > } //< > // </2.1.3. Code : Interface : iGetTicket > //< > AIRAT SAFIN 2010.03.18 10:35 #54 ////////////////////////////////////////////////////////////////////< 7> // < 2.1.4. Code : Interface : iTryOpen > //< > int iTryOpen () // - i 15 l - o //< > { //< > int iCommand = iSignalOpen () ; //< > if ( iCommand == EMPTY ) return ; //< > if ( iCommand == OP_BUY ) //< > { string sType = "Buy" ; int iColor = Blue ; } //< > else { sType = "Sell" ; iColor = Red ; } //< > // //< > if ( iCommand == OP_BUY ) int iMode = MODE_ASK ; //< > else iMode = MODE_BID ; //< > double dPrice = MarketInfo ( Symbol () , iMode ) ; //< > // //< > OrderSend ( Symbol () , iCommand , dLots , //< > NormalizeDouble ( dPrice , Digits ) , //< > iSlippage , 0 , 0 , "" , iMagic , 0 , iColor ) ; //< > // //< > int iTrap = GetLastError () ; //< > if ( iTrap == 0 ) //< > Alert ( sType , " Was a Big Success" ) ; //< > else Alert ( sType , " open exception " , iTrap ) ; //< > } //< > // </2.1.4. Code : Interface : iTryOpen > //< > ////////////////////////////////////////////////////////////////////< 8> // < 2.1.5. Code : Interface : iTryClose > //< > int iTryClose () // - i 15 l - o //< > { //< > int iCommand = iSignalClose () ; //< > if ( iCommand == EMPTY ) return ; //< > if ( OrderType () == OP_BUY ) //< > { string sType = "Buy" ; int iColor = Red ; } //< > else { sType = "Sell" ; iColor = Blue ; } //< > // //< > if ( OrderProfit () > 0 ) string sAct = "Take" ; //< > else sAct = "Stop" ; //< > double dPrice = OrderClosePrice () ; //< > // //< > OrderClose ( OrderTicket () , OrderLots () , //< > NormalizeDouble ( dPrice , Digits ) , //< > iSlippage , iColor ) ; //< > // //< > int iTrap = GetLastError () ; //< > if ( iTrap == 0 ) //< > Alert ( sType , " closed with Hard " , sAct ) ; //< > else Alert ( sType , " close exception " , iTrap ) ; //< > } //< > // </2.1.5. Code : Interface : iTryClose > //< > AIRAT SAFIN 2010.03.18 10:35 #55 ////////////////////////////////////////////////////////////////////< 9> // < 2.2. Code : Special > //< > // //< > // < 2.2. Special 3 / - i 11 l - o > //< > // < 1. init - i 1 l - o /> //< > // < 2. deinit - i 1 l - o /> //< > // < 3. start - i 9 l - o /> //< > // </2.2. Special 3 / - i 11 l - o > //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // </2.2. Code : Special > //< > ////////////////////////////////////////////////////////////////////< 10> // < 2.2.1. Code : Special : Init > //< > int init () // - i 1 l - o //< > { //< > Alert ( "" , "Start " , UninitializeReason () ) ; //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > } //< > // </2.2.1. Code : Special : Init > //< > AIRAT SAFIN 2010.03.18 10:35 #56 ////////////////////////////////////////////////////////////////////< 11> // < 2.2.2. Code : Special : Deinit > //< > int deinit () // - i 1 l - o //< > { //< > Alert ( "" , "Stop " , UninitializeReason () ) ; //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > } //< > // </2.2.2. Code : Special : Deinit > //< > ////////////////////////////////////////////////////////////////////< 12> // < 2.2.3. Code : Special : Start > //< > int start () // - i 9 l - o //< > { //< > // < 2.2.3.1. History data inspection 4 >`````````````````````````//< > static int iTrigger = 0 ; if ( iTrigger == 0 ) { //< > if ( ( iTime ( 0 , 0 , 0 ) == 0 ) //< > || ( iBars ( 0 , 0 ) < iBaseLag + iBaseBar ) ) //< > return ; else iTrigger = 1 ; } //< > // </2.2.3.1. History data inspection 4 >`````````````````````````//< > // //< > // < 2.2.3.2. Main routine 3 >````````````````````````````````````//< > int iTicket = iGetTicket () ; //< > // //< > if ( iTicket < 0 ) iTryOpen () ; //< > else iTryClose () ; //< > // </2.2.3.2. Main routine 3 >````````````````````````````````````//< > // //< > // < 2.2.3.3. Exception handler 2 >```````````````````````````````//< > int iTrap = GetLastError () ; //< > if ( iTrap > 0 ) Alert ( "Exception " , iTrap ) ; //< > // </2.2.3.3. Exception handler 2 >```````````````````````````````//< > } //< > // </2.2.3. Code : Special : Start > //< > ////////////////////////////////////////////////////////////////////< 0> AIRAT SAFIN 2010.03.18 10:38 #57 完整的变化清单。 1.虚拟获利 因素的初始值 "double dFactorTP = 1.0; "已被改变。 2.域 "数据:缓冲区 "已被删除。 3.3.函数 "iNewBar() "已被删除。 4.函数 "iSignalOpen() "已被修改。 5.函数 "iSignalClose() "已被修改。 最后编辑: 2010.03.18 20:47 状态。Ready 附加的文件: 1_26.mq4 24 kb cameo 2010.03.18 13:08 #58 艾斯。 谢谢你分享你的系统。 你有一些编码系统。你有令人难以置信的纪律:)你在Excel中输入它,让它对齐? cameo 2010.03.18 13:26 #59 cameofx: Ais, 谢谢你分享你的系统。 你有一些编码系统。你有令人难以置信的纪律:)你在Excel中输入它,让它对齐? 也许这是个愚蠢的问题,但我很好奇:) PS.Huckleberry 谢谢你一直在做这个工作。 AIRAT SAFIN 2010.03.18 16:27 #60 你好,Cameofx, 谢谢你的回复。 这个编码系统非常简单易行。 所有的工作都是在MetaEditor中手动完成的。 事实上,该系统的设计是为了方便和高速地开发大型程序。 该系统也应该是灵活和可靠的。 最好的问候! 123456789 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
////////////////////////////////////////////////////////////////////< 1> // < Program : Property > //< > // #define 1 " " //< > // #define 2 " " //< > // </Program : Property > //< > // //< > // //< > // < Program : Content > //< > // //< > // < Structure 15 elements in 3 domains > //< > // < 1. Data 7 elements in 1 domains /> //< > // < 2. Code 8 elements in 2 domains /> //< > // </Structure 15 elements in 3 domains > //< > // //< > // < 1. Data 7 = 4 i 3 d - s > //< > // < 1.1. Input 7 = 4 i 3 d - s /> //< > // </1. Data 7 = 4 i 3 d - s > //< > // //< > // < 2. Code 8 / - i 77 l 3 o > //< > // < 2.1. Interface 5 / - i 66 l 3 o /> //< > // < 2.2. Special 3 / - i 11 l - o /> //< > // </2. Code 8 / - i 77 l 3 o > //< > // //< > // </Program : Content > //< >
////////////////////////////////////////////////////////////////////< 2> // < 1.1. Data : Input > //< > // //< > // < 1.1. Input 7 = 4 i 3 d - s > //< > // < 1. Strategy 4 = 2 i 2 d - s /> //< > // < 2. Trading 3 = 2 i 1 d - s /> //< > // </1.1. Input 7 = 4 i 3 d - s > //< > // //< > // < 1. Strategy 4 >=========================================//< > int iBaseLag = 20 ; //< > int iBaseBar = 1 ; //< > double dFactorTP = 1.0 ; //< > double dFactorSL = 2.0 ; //< > // </ 1. Strategy 4 >=========================================//< > // //< > // < 2. Trading 3 >==========================================//< > int iSlippage = 1 ; //< > int iMagic = 1 ; //< > double dLots = 0.1 ; //< > // </ 2. Trading 3 >==========================================//< > // //< > // //< > // //< > // </1.1. Data : Input > //< >
////////////////////////////////////////////////////////////////////< 3> // < 2.1. Code : Interface > //< > // //< > // < 2.1. Interface 5 / - i 66 l 3 o > //< > // < 1. iSignalOpen - i 14 l 1 o /> //< > // < 2. iSignalClose - i 15 l 1 o /> //< > // < 3. iGetTicket - i 7 l 1 o /> //< > // < 4. iTryOpen - i 15 l - o /> //< > // < 5. iTryClose - i 15 l - o /> //< > // </2.1. Interface 5 / - i 66 l 3 o > //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // </2.1. Code : Interface > //< >
////////////////////////////////////////////////////////////////////< 4> // < 2.1.1. Code : Interface : iSignalOpen > //< > int iSignalOpen () // - i 14 l 1 o //< > { //< > static int iTime_0 = EMPTY ; //< > if ( iTime_0 < iTime ( 0 , 0 , 0 ) ) //< > { iTime_0 = iTime ( 0 , 0 , 0 ) ; //< > static double dHighest , dLowest ; //< > // //< > dHighest = High [ iHighest ( 0 , 0 , MODE_HIGH , //< > iBaseLag , iBaseBar ) ] ; //< > // //< > dLowest = Low [ iLowest ( 0 , 0 , MODE_LOW , //< > iBaseLag , iBaseBar ) ] ; //< > } // if //< > // //< > double dAsk = MarketInfo ( Symbol () , MODE_ASK ) ; //< > double dBid = MarketInfo ( Symbol () , MODE_BID ) ; //< > // //< > if ( dAsk > dHighest ) return ( OP_BUY ) ; //< > if ( dBid < dLowest ) return ( OP_SELL ) ; //< > return ( EMPTY ) ; //< > } //< > // </2.1.1. Code : Interface : iSignalOpen > //< >
////////////////////////////////////////////////////////////////////< 5> // < 2.1.2. Code : Interface : iSignalClose > //< > int iSignalClose () // - i 15 l 1 o //< > { //< > static int iTime_0 = EMPTY ; //< > if ( iTime_0 < iTime ( 0 , 0 , 0 ) ) //< > { iTime_0 = iTime ( 0 , 0 , 0 ) ; //< > static double dATR , dProfit , dLoss ; //< > dATR = iATR ( 0 , 0 , iBaseLag , iBaseBar ) ; //< > } // if //< > // //< > double dDelta = OrderOpenPrice () - OrderClosePrice () ; //< > // //< > if ( OrderType () == OP_BUY ) //< > { dProfit = -dDelta ; dLoss = dDelta ; } //< > else if ( OrderType () == OP_SELL ) //< > { dProfit = dDelta ; dLoss = -dDelta ; } //< > else return ( EMPTY ) ; //< > // //< > if ( dProfit > dATR * dFactorTP ) return ( TRUE ) ; //< > if ( dLoss > dATR * dFactorSL ) return ( TRUE ) ; //< > return ( EMPTY ) ; //< > } //< > // </2.1.2. Code : Interface : iSignalClose > //< >
////////////////////////////////////////////////////////////////////< 6> // < 2.1.3. Code : Interface : iGetTicket > //< > int iGetTicket () // - i 7 l 1 o //< > { //< > for ( int i = OrdersTotal () - 1 ; i >= 0 ; i -- ) //< > { //< > if ( OrderSelect ( i , SELECT_BY_POS ) == TRUE ) //< > if ( OrderMagicNumber () == iMagic ) //< > return ( OrderTicket () ) ; //< > } // for //< > return ( EMPTY ) ; //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > } //< > // </2.1.3. Code : Interface : iGetTicket > //< >
////////////////////////////////////////////////////////////////////< 7> // < 2.1.4. Code : Interface : iTryOpen > //< > int iTryOpen () // - i 15 l - o //< > { //< > int iCommand = iSignalOpen () ; //< > if ( iCommand == EMPTY ) return ; //< > if ( iCommand == OP_BUY ) //< > { string sType = "Buy" ; int iColor = Blue ; } //< > else { sType = "Sell" ; iColor = Red ; } //< > // //< > if ( iCommand == OP_BUY ) int iMode = MODE_ASK ; //< > else iMode = MODE_BID ; //< > double dPrice = MarketInfo ( Symbol () , iMode ) ; //< > // //< > OrderSend ( Symbol () , iCommand , dLots , //< > NormalizeDouble ( dPrice , Digits ) , //< > iSlippage , 0 , 0 , "" , iMagic , 0 , iColor ) ; //< > // //< > int iTrap = GetLastError () ; //< > if ( iTrap == 0 ) //< > Alert ( sType , " Was a Big Success" ) ; //< > else Alert ( sType , " open exception " , iTrap ) ; //< > } //< > // </2.1.4. Code : Interface : iTryOpen > //< >
////////////////////////////////////////////////////////////////////< 8> // < 2.1.5. Code : Interface : iTryClose > //< > int iTryClose () // - i 15 l - o //< > { //< > int iCommand = iSignalClose () ; //< > if ( iCommand == EMPTY ) return ; //< > if ( OrderType () == OP_BUY ) //< > { string sType = "Buy" ; int iColor = Red ; } //< > else { sType = "Sell" ; iColor = Blue ; } //< > // //< > if ( OrderProfit () > 0 ) string sAct = "Take" ; //< > else sAct = "Stop" ; //< > double dPrice = OrderClosePrice () ; //< > // //< > OrderClose ( OrderTicket () , OrderLots () , //< > NormalizeDouble ( dPrice , Digits ) , //< > iSlippage , iColor ) ; //< > // //< > int iTrap = GetLastError () ; //< > if ( iTrap == 0 ) //< > Alert ( sType , " closed with Hard " , sAct ) ; //< > else Alert ( sType , " close exception " , iTrap ) ; //< > } //< > // </2.1.5. Code : Interface : iTryClose > //< >
////////////////////////////////////////////////////////////////////< 9> // < 2.2. Code : Special > //< > // //< > // < 2.2. Special 3 / - i 11 l - o > //< > // < 1. init - i 1 l - o /> //< > // < 2. deinit - i 1 l - o /> //< > // < 3. start - i 9 l - o /> //< > // </2.2. Special 3 / - i 11 l - o > //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // </2.2. Code : Special > //< >
////////////////////////////////////////////////////////////////////< 10> // < 2.2.1. Code : Special : Init > //< > int init () // - i 1 l - o //< > { //< > Alert ( "" , "Start " , UninitializeReason () ) ; //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > } //< > // </2.2.1. Code : Special : Init > //< >
////////////////////////////////////////////////////////////////////< 11> // < 2.2.2. Code : Special : Deinit > //< > int deinit () // - i 1 l - o //< > { //< > Alert ( "" , "Stop " , UninitializeReason () ) ; //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > // //< > } //< > // </2.2.2. Code : Special : Deinit > //< >
////////////////////////////////////////////////////////////////////< 12> // < 2.2.3. Code : Special : Start > //< > int start () // - i 9 l - o //< > { //< > // < 2.2.3.1. History data inspection 4 >`````````````````````````//< > static int iTrigger = 0 ; if ( iTrigger == 0 ) { //< > if ( ( iTime ( 0 , 0 , 0 ) == 0 ) //< > || ( iBars ( 0 , 0 ) < iBaseLag + iBaseBar ) ) //< > return ; else iTrigger = 1 ; } //< > // </2.2.3.1. History data inspection 4 >`````````````````````````//< > // //< > // < 2.2.3.2. Main routine 3 >````````````````````````````````````//< > int iTicket = iGetTicket () ; //< > // //< > if ( iTicket < 0 ) iTryOpen () ; //< > else iTryClose () ; //< > // </2.2.3.2. Main routine 3 >````````````````````````````````````//< > // //< > // < 2.2.3.3. Exception handler 2 >```````````````````````````````//< > int iTrap = GetLastError () ; //< > if ( iTrap > 0 ) Alert ( "Exception " , iTrap ) ; //< > // </2.2.3.3. Exception handler 2 >```````````````````````````````//< > } //< > // </2.2.3. Code : Special : Start > //< > ////////////////////////////////////////////////////////////////////< 0>
完整的变化清单。
1.虚拟获利 因素的初始值 "double dFactorTP = 1.0; "已被改变。
2.域 "数据:缓冲区 "已被删除。
3.3.函数 "iNewBar() "已被删除。
4.函数 "iSignalOpen() "已被修改。
5.函数 "iSignalClose() "已被修改。
最后编辑: 2010.03.18 20:47
状态。Ready
谢谢你分享你的系统。
你有一些编码系统。你有令人难以置信的纪律:)你在Excel中输入它,让它对齐?
Ais,
谢谢你分享你的系统。
你有一些编码系统。你有令人难以置信的纪律:)你在Excel中输入它,让它对齐?
也许这是个愚蠢的问题,但我很好奇:)
PS.Huckleberry 谢谢你一直在做这个工作。
你好,Cameofx,
谢谢你的回复。
这个编码系统非常简单易行。
所有的工作都是在MetaEditor中手动完成的。
事实上,该系统的设计是为了方便和高速地开发大型程序。
该系统也应该是灵活和可靠的。
最好的问候!