North East Way

North East Way

更新日期:2022-11-16分类标签: 语言:中文平台:没限制

534 人已下载 手机查看

 

North East Way North East Way North East Way

 

 

//+——————————————————————+
//| 东北路源码.mq4 |
//| Copyright 2020, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+——————————————————————+
#include <Controls\Dialog.mqh>
#include <Controls\Button.mqh>
#include <Controls\Edit.mqh>
#include <Controls\ListView.mqh>
#include <Controls\ComboBox.mqh>
#include <Controls\SpinEdit.mqh>
#include <Controls\RadioGroup.mqh>
#include <Controls\CheckGroup.mqh>
//+——————————————————————+
//| defines |
//+——————————————————————+
//— indents and gaps
#define INDENT_LEFT (11) // indent from left (with allowance for border width)
#define INDENT_TOP (11) // indent from top (with allowance for border width)
#define INDENT_RIGHT (11) // indent from right (with allowance for border width)
#define INDENT_BOTTOM (11) // indent from bottom (with allowance for border width)
#define CONTROLS_GAP_X (-10010) // gap by X coordinate
#define CONTROLS_GAP_Y (10) // gap by Y coordinate
#define BUTTON_WIDTH (100) // size by X coordinate
#define BUTTON_HEIGHT (20) // size by Y coordinate
#define EDIT_HEIGHT (20) // size by Y coordinate
//+——————————————————————+
//| Class CPanelDialog |
//| Usage: main dialog of the SimplePanel application |
//+——————————————————————+
//+——————————————————————+
//| |
//+——————————————————————+
#property link “Telegram channel: https://t.me/new_signals”
#property description “Advisor trade the average price return on non-trending pairs correlated with each other.”
#property description “Use ECN accounts with a minimum spread and commissions.”
#property description “When EA trades, many small transactions are simultaneously opened on the account.”
#property description “This allows you to diversify trading entrances and exits from the market.”
#property strict
//+——————————————————————+
//| Expert initialization function |
//+——————————————————————+
enum 子_ino_1
{
Long_and_Short=1,
Long=2,
Short=3,
NotOpen=4,
};
enum 子_ino_2
{
days_14=1,
days_7=2,
days_0=3,
};
enum 子_ino_3
{
equity=1,
balance=2,
};
input string _base_=”=========Basic settings=========”;
input string 总_st_1=””;//OneChartSetup multi currency mode.
input string 总_st_2=”new”;//Prefix for comment
input 子_ino_1 总_lo_1=Long_and_Short;//First Position
input bool 总_bo_1=false;//Emergency closing at breakeven
input int 总_lo_2=1;//For magic: 0 to 99
input 子_ino_2 总_lo_3=days_14;//Duration of the weekend after the New Year
input bool 总_bo_2=false;//Using a virtual take-profit?
input string _mm_=”=========Money Management Sellings=========”;
input int 总_lo_4=0;//Number of magics no more:
input int 总_lo_5=0;//Number of symbols no more:
input 子_ino_3 总_lo_6=equity;//For autolot use
input double 总_do_1=0.0;//Additional funds in account currency
input double 总_do_2=0.0;//Or use fix balance in account currency
input double 总_do_3=0.0;//AutoMM. Aggressive=1000, Conservative=5000.
//#resource “\\Experts\\iphea.bmp”
input double 总_do_4=0.01;//Fix lot if AutoMM=0
input string _aver_=”=========Averaging Sellings=========”;
input bool 总_bo_3=true;//Recovery Mode
input double 总_do_5=2.5;//Martin ratio
input string _grid_=”=========Grid Level Sellings=========”;
input int 总_lo_7=3;//First real deal from this level n>=0
string 总_st_3 = “AUDNZD”;
string 总_st_4 = “NZDCAD”;
string 总_st_5 = “AUDCAD”;
string 总_st_6 = “EURGBP”;
string 总_st_7 = “EURUSD”;
string 总_st_8 = “GBPUSD”;
string 总_st_9 = “USDCAD”;
string 总_st_10 = “GBPCAD”;
string 总_st_11 = “EURCAD”;
double 总_do_47 = 250.0;
bool 总_bo_48 = false;
double 总_do_49 = 25.0;
bool 总_bo_50 = true;
double 总_do_51 = 30.0;
double InitLots;
double Spread;
double 总_do_52 = 0.0;
double 总_do_53 = 3.88;
double 总_do_54 = 0.0;
int 总_in_55 = 1000;
bool 总_bo_56 = true;
double 总_do_57 = 2.0;
double 总_do_58 = 0.1;
bool 总_bo_59 = false;
double 总_do_60 = 9000.0;
double 总_do_61 = 9000.0;
bool 总_bo_62 = true;
bool 总_bo_63 = true;
int 总_in_64 = 20;
int 总_in_65 = 2;
int 总_in_66 = 0;
bool 总_bo_67 = true;
int 总_in_68 = 5;
int 总_in_69 = 3;
int 总_in_70 = 3;
int StopMinute=0 ;
//#resource “\\Experts\\iphe.bmp”
int FridayProhibitStartHour=24 ;
int FridayProhibitStartMinute=0 ;
color LongColor=Blue ;
color ShortColor=Red ;
int MAGIC=88648 ;
int 总_in_71 = 0;
int 总_in_72 = 0;
int 总_in_73 = 30;
//#resource “\\Experts\\ipheb.bmp”
int 总_in_74 = 70;
bool 总_bo_75 = true;
int 总_in_76 = 12;
int 总_in_77 = 0;
int 总_in_78 = 30;
int 总_in_79 = 70;
double 总_do_80 = 0.0;
double 总_do_81 = 0.0;
double 总_do_82 = 0.0;
int 总_in_83 = 2;
int 总_in_84 = 200;
double Lots=0;
int PointX;
string TrendJud;
double DirectCloseLevel=12 ;
double ProfitPoint=20 ;
int 总_in_85 = 1000;
int 总_in_86 = 600;
int 总_in_87 = 600;
int 总_in_88 = 400;
int 总_in_89 = 10;
int 总_in_90 = 30;
int 总_in_91 = 20;
int 总_in_92 = 280;
string 总_st_93;
string 总_st_94;
string 总_st_95;
string 总_st_96;
string 总_st_97;
string 总_st_98;
string 总_st_99;
string 总_st_100;
int TrendPeriod=66;
double TrendGap=60 ;
string OscJud;
int OSCPeriod=9 ;
double OSCGap=12 ;
string EnterJud;
double OSCLevel=10 ;
//#resource “\\Experts\\iphec.bmp”
string 总_st_101;
string 总_st_102;
string 总_st_103;
string 总_st_104;
string 总_st_105;
string 总_st_106;
string 总_st_107;
string 总_st_108;
string 总_st_109;
string 总_st_110;
string 总_st_111;
string 总_st_112;
string 总_st_113;
int SLPeriod=66 ;
double MinSL=100 ;
double MaxSL=120 ;
int StartHour=0 ;
int StartMinute=0 ;
int StopHour=24 ;
string 总_st_114;
string 总_st_115;
string 总_st_116;
bool 总_bo_117 = false;
double 总_do_118 = 0.0;
int 总_in_119 = 0;
int 总_in_120 = 0;
long 总_lo_121 = 0;
double 总_do_122 = 0.0;
long 总_lo_123 = 0;
long 总_lo_124 = 0;
long 总_lo_125 = 0;
//#resource “\\Experts\\iphed.bmp”
int magic=0;
string CompatibleSymbol;

 

//+——————————————————————+
//| |
//+——————————————————————+
int OnInit()
{
//—
string 子_st_2;
string 子_st_3;
总_in_120 = 1000.0;
chd();
总_in_92 = 100;
总_in_91 = 100;
//—
return(INIT_SUCCEEDED);
}
//+——————————————————————+
//| Expert deinitialization function |
//+——————————————————————+
void OnDeinit(const int reason)
{
//—

}
//+——————————————————————+
//| Expert tick function |
//+——————————————————————+
void OnTick()
{
//—
string 子_st_1;
string 子_st_2;
string 子_st_3;
string 子_st_4;
string 子_st_5;
int 子_in_6;
string 子_st_7;
int 子_in_8;
double 子_do_9;
double 子_do_10;
double 子_do_11;
double 子_do_12;
double 子_do_13;
double 子_do_14;
double 子_do_15;
string 子_st_16;
string 子_st_17;
string 子_st_18;
string 子_st_19;
string 子_st_20;
string 子_st_21;
double 子_do_22;
buy_fist(子_st_16,子_do_22);
sell_fist(子_st_16,子_do_22);
buy_jia(子_st_3);
sell_jia(子_st_3);

//—————————-
string 临_st_120; //3125
int 临_in_11;
string 临_st_121; //3128
signal(子_st_7);
}
//+——————————————————————+
int signal(string 木_0)
{
double 子_do_1;
double 子_do_2;
double 子_do_3;
double 子_do_4;
int 总_in_41;
//—————————-

子_do_1 = iBands(木_0,总_in_41,总_in_64,总_in_65,0,0,1,总_in_66);
子_do_2 = iBands(木_0,总_in_41,总_in_64,总_in_65,0,0,2,总_in_66);
子_do_3 = iStochastic(木_0,总_in_41,总_in_68,总_in_69,总_in_70,0,总_in_71,1,总_in_72);
子_do_4 = iRSI(木_0,总_in_41,总_in_76,0,总_in_77);
if(总_bo_63 && 总_bo_67 && 总_bo_75)
{
if(iHigh(木_0,总_in_41,总_in_66)>子_do_1 && 子_do_3>总_in_74 && 子_do_4>总_in_79)
{
return(2);
}
if(iLow(木_0,总_in_41,总_in_66)<子_do_2 && 子_do_3<总_in_73 && 子_do_4<总_in_78)
{
return(-2);
}
}
if(总_bo_63 && 总_bo_67 && !(总_bo_75))
{
if(iHigh(木_0,总_in_41,总_in_66)>子_do_1 && 子_do_3>总_in_74)
{
return(2);
}
if(iLow(木_0,总_in_41,总_in_66)<子_do_2 && 子_do_3<总_in_73)
{
return(-2);
}
}
if(总_bo_63 && !(总_bo_67) && !(总_bo_75))
{
if(iHigh(木_0,总_in_41,总_in_66)>子_do_1)
{
return(2);
}
if(iLow(木_0,总_in_41,总_in_66)<子_do_2)
{
return(-2);
}
}
if(!(总_bo_63) && 总_bo_67 && 总_bo_75)
{
if(子_do_3>总_in_74 && 子_do_4>总_in_79)
{
return(2);
}
if(子_do_3<总_in_73 && 子_do_4<总_in_78)
{
return(-2);
}
}
if(!(总_bo_63) && 总_bo_67 && !(总_bo_75))
{
if(子_do_3>总_in_74)
{
return(2);
}
if(子_do_3<总_in_73)
{
return(-2);
}
}
if(总_bo_63 && !(总_bo_67) && 总_bo_75)
{
if(iHigh(木_0,总_in_41,总_in_66)>子_do_1 && 子_do_4>总_in_79)
{
return(2);
}
if(iLow(木_0,总_in_41,总_in_66)<子_do_2 && 子_do_4<总_in_78)
{
return(-2);
}
}
if(!(总_bo_63) && !(总_bo_67) && 总_bo_75)
{
if(子_do_4>总_in_79)
{
return(2);
}
if(子_do_4<总_in_78)
{
return(-2);
}
}
return(0);
}
//+——————————————————————+
void buy_fist(string 木_0,double 木_1)
{
//int 子_in_1;
long 子_lo_2;
bool 子_bo_3;
bool 子_bo_4;
double 子_do_5;
int 子_in_6;

//—————————-
子_lo_2 = 0;
子_bo_3 = false;
子_bo_4 = false;
子_do_5 = 0.0;
子_do_5 = MarketInfo(木_0,23);
if(木_1<子_do_5)
{
子_bo_4=true;
木_1=子_do_5;
}
子_in_6=0;
if(signal(木_0)==-2) //&& cheakorders(木_0) )//&& (子_bo_3==false || TimeCurrent()-子_lo_2>=子_in_1))
{
if(总_bo_59)
{
子_in_6=OrderSend(木_0,OP_BUY,木_1,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),””,magic,0,0xFFFFFFFF);
}
else
{
子_in_6=OrderSend(木_0,OP_BUY,木_1,MarketInfo(木_0,10),30,0.0,0.0,””,magic,0,0xFFFFFFFF);
}
if(子_in_6>0 && 子_bo_4)
{
}
}
}
//+——————————————————————+
void sell_fist(string 木_0,double 木_1)
{
//int 子_in_1;
long 子_lo_2;
bool 子_bo_3;
bool 子_bo_4;
double 子_do_5;
int 子_in_6;

子_lo_2 = 0;
子_bo_3 = false;
子_bo_4 = false;
子_do_5 = 0.0;
子_do_5 = MarketInfo(木_0,23);
if(木_1<子_do_5)
{
子_bo_4=true;
木_1=子_do_5;
}
子_in_6=0;
if(signal(木_0)==2)
{
if(总_bo_59)
{
子_in_6=OrderSend(木_0,OP_SELL,木_1,MarketInfo(木_0,9),30,总_do_60*MarketInfo(木_0,11)+MarketInfo(木_0,9),MarketInfo(木_0,9)-总_do_61*MarketInfo(木_0,11),””,magic,0,0xFFFFFFFF);
}
else
{
子_in_6=OrderSend(木_0,OP_SELL,木_1,MarketInfo(木_0,9),30,0.0,0.0,””,magic,0,0xFFFFFFFF);
}
if(子_in_6>0 && 子_bo_4)
{

}
}
}

//+——————————————————————+
//| |
//+——————————————————————+
void buy_jia(string 木_0)
{
int 子_in_1;
int 子_in_2;
int 子_in_3;
double 子_do_4;
string 子_st_5;
int 子_in_6;
string 子_st_7;
double 子_do_8;
double 子_do_9;
double 子_do_10;

//—————————-

子_st_5 = 0;
子_in_6 = 0;
子_in_6 = StringToInteger(子_st_5);
子_st_7 = “”+IntegerToString(子_in_6 + 1);
子_do_8 = 0.0;
子_do_9 = 0.0;
子_do_8 = 0;
子_do_8 = NormalizeDouble(子_do_8 * 总_do_57,总_in_83);
子_do_10= 0.0;
if(子_do_4-MarketInfo(木_0,10)>=总_do_54*MarketInfo(木_0,11))
{
if(总_bo_59)
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
}
}
if(!(总_bo_59))
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
}
}
}
if(子_do_4-MarketInfo(木_0,10)>=总_do_54*MarketInfo(木_0,11))
{
if(总_bo_59)
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
}
}
if(!(总_bo_59))
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
}
}
}
if(子_do_4-MarketInfo(木_0,10)>=总_do_54*MarketInfo(木_0,11))
{
if(总_bo_59)
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
}
}
if(!(总_bo_59))
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
}
}
}
if(子_do_4-MarketInfo(木_0,10)>=总_do_54*MarketInfo(木_0,11))
{
if(总_bo_59)
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
}
}
if(!(总_bo_59))
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
}
}
}
if(子_do_4-MarketInfo(木_0,10)>=总_do_54*MarketInfo(木_0,11))
{
if(总_bo_59)
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,MarketInfo(木_0,10)-总_do_60*MarketInfo(木_0,11),总_do_61*MarketInfo(木_0,11)+MarketInfo(木_0,10),子_st_7,magic,0,0xFFFFFFFF);
}
}
}
if(!(总_bo_59))
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_BUY,子_do_8,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_BUY,总_do_51,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_BUY,子_do_9,MarketInfo(木_0,10),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
}
}
}
}
//buy_jia
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
void sell_jia(string 木_0)
{
int 子_in_1;
int 子_in_2;
int 子_in_3;
double 子_do_4;
string 子_st_5;
int 子_in_6;
string 子_st_7;
double 子_do_8;
double 子_do_9;
double 子_do_10;

//—————————-

子_st_5 = 542;
子_in_6 = 0;
子_in_6 = StringToInteger(子_st_5);
子_st_7 = “”+IntegerToString(子_in_6 + 1);
子_do_8 = 0.0;
子_do_9 = 0.0;
子_do_8 = 0;
子_do_8 = NormalizeDouble(子_do_8 * 总_do_57,总_in_83);
子_do_10= 0.0;
if(MarketInfo(木_0,9)-子_do_4>=总_do_54*MarketInfo(木_0,11))
{
if(总_bo_59)
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_SELL,子_do_8,MarketInfo(木_0,9),30,总_do_60*MarketInfo(木_0,11)+MarketInfo(木_0,9),MarketInfo(木_0,9)-总_do_61*MarketInfo(木_0,11),子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_SELL,总_do_51,MarketInfo(木_0,9),30,总_do_60*MarketInfo(木_0,11)+MarketInfo(木_0,9),MarketInfo(木_0,9)-总_do_61*MarketInfo(木_0,11),子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_SELL,子_do_9,MarketInfo(木_0,9),30,总_do_60*MarketInfo(木_0,11)+MarketInfo(木_0,9),MarketInfo(木_0,9)-总_do_61*MarketInfo(木_0,11),子_st_7,magic,0,0xFFFFFFFF);
}
}
}
if(!(总_bo_59))
{
if(子_do_8<=总_do_51)
{
子_in_1=OrderSend(木_0,OP_SELL,子_do_8,MarketInfo(木_0,9),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
if(子_do_8>总_do_51)
{
子_do_10 = 子_do_8 / 总_do_51;
子_do_10 = 子_do_10;
子_do_9=子_do_8-子_do_10*总_do_51;
while(子_in_3<子_do_10)
{
子_in_1=OrderSend(木_0,OP_SELL,总_do_51,MarketInfo(木_0,9),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
if(子_in_1>0)
{
子_in_3=子_in_3+1;
}
}
while(子_in_2<=0)
{
子_in_2=OrderSend(木_0,OP_SELL,子_do_9,MarketInfo(木_0,9),30,0.0,0.0,子_st_7,magic,0,0xFFFFFFFF);
}
}
}
}
}

//+——————————————————————+
//| |
//+——————————————————————+
bool cheakorders_sell(string 木_0)
{
int 子_in_1;
bool 子_bo_2;

//—————————-

子_bo_2=true;
if(OrdersTotal()>0)
{
for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderType()==1 && OrderSymbol()==木_0 && OrderMagicNumber()==magic)
{
子_bo_2=false;
break;
}
}
}
return(子_bo_2);
}
//cheakorders_sell
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
bool cheakorders(string 木_0)
{
int 子_in_1;
bool 子_bo_2;

//—————————-

子_bo_2=true;
for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==1 || OrderType()==0) && OrderMagicNumber()==magic && OrderSymbol()==木_0)
{
子_bo_2=false;
break;
}
}

for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==1 || OrderType()==0) && OrderMagicNumber()==magic && OrderSymbol()==木_0)
{
子_bo_2=false;
break;
}
}
for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==1 || OrderType()==0) && OrderMagicNumber()==magic && OrderSymbol()==木_0)
{
子_bo_2=false;
break;
}
}
for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==1 || OrderType()==0) && OrderMagicNumber()==magic && OrderSymbol()==木_0)
{
子_bo_2=false;
break;
}
}
for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==1 || OrderType()==0) && OrderMagicNumber()==magic && OrderSymbol()==木_0)
{
子_bo_2=false;
break;
}
}
for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==1 || OrderType()==0) && OrderMagicNumber()==magic && OrderSymbol()==木_0)
{
子_bo_2=false;
break;
}
}

return(子_bo_2);
}
//cheakorders
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
bool cheakorders_buy(string 木_0)
{
int 子_in_1;
bool 子_bo_2;

//—————————-

子_bo_2=true;
for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderType()==0 && OrderSymbol()==木_0 && OrderMagicNumber()==magic)
{
子_bo_2=false;
break;
}
}
return(子_bo_2);
}
//cheakorders_buy
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
int total(string 木_0)
{
int 子_in_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==0 || OrderType()) && OrderSymbol()==木_0 && OrderMagicNumber()==magic)
{
子_in_1=子_in_1+1;
}
}
return(子_in_1);
}

//+——————————————————————+
//| |
//+——————————————————————+
double dailyprofit(string 木_0)
{
int 子_in_1;
double 子_do_2;
int 子_in_3;

//—————————-

子_in_1 = Day();
子_do_2 = 0.0;
for(子_in_3=0; 子_in_3<HistoryTotal(); 子_in_3=子_in_3+1)
{
if(!(OrderSelect(子_in_3,SELECT_BY_POS,MODE_HISTORY)!=false))
break;
if(OrderSymbol()==木_0 && OrderMagicNumber()==magic && TimeDay(OrderOpenTime())==子_in_1)
{
子_do_2=子_do_2+OrderProfit();
}
}
return(子_do_2);
}
//dailyprofit
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
void closeall(string 木_0)
{
int 子_in_1;
int 子_in_2;
int 子_in_3;
bool 子_bo_4;

//—————————-

子_in_1=OrdersTotal();
for(子_in_2=子_in_1-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES) != false))
return;
if(OrderMagicNumber()==magic && OrderSymbol()==木_0)
{
子_in_3 = OrderType();
子_bo_4 = true;
switch(子_in_3)
{
case 0 :
子_bo_4=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),9),30,0xFFFFFFFF);
break;
case 1 :
子_bo_4=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),10),30,0xFFFFFFFF);
}
if(子_bo_4==false)
{
Sleep(总_in_84);
}
}
}

子_in_1=OrdersTotal();
for(子_in_2=子_in_1-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES) != false))
return;
if(OrderMagicNumber()==magic && OrderSymbol()==木_0)
{
子_in_3 = OrderType();
子_bo_4 = true;
switch(子_in_3)
{
case 0 :
子_bo_4=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),9),30,0xFFFFFFFF);
break;
case 1 :
子_bo_4=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),10),30,0xFFFFFFFF);
}
if(子_bo_4==false)
{
Sleep(总_in_84);
}
}
}
}
//closeall
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
double lots_order_buy(string 木_0,double &木_1)
{
double 子_do_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderType()==0 && OrderSymbol()==木_0 && OrderMagicNumber()==magic)
{
子_do_1=OrderLots();
break;
}
}
return(子_do_1);
}
//lots_order_buy
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
double lots_order_sell(string 木_0,double &木_1)
{
double 子_do_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderType()==1 && OrderSymbol()==木_0 && OrderMagicNumber()==magic)
{
子_do_1=OrderLots();
break;
}
}
return(子_do_1);
}
//lots_order_sell
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
string lastorder_com_buy(string 木_0,double &木_1)
{
string 子_st_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderMagicNumber()==magic && OrderType()==0 && OrderSymbol()==木_0)
{
子_st_1=OrderComment();
木_1=OrderOpenPrice();
break;
}
}
return(子_st_1);
}

//+——————————————————————+
//| |
//+——————————————————————+
string lastorder_com_sell(string 木_0,double &木_1)
{
string 子_st_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderMagicNumber()==magic && OrderType()==1 && OrderSymbol()==木_0)
{
子_st_1=OrderComment();
木_1=OrderOpenPrice();
break;
}
}
return(子_st_1);
}
//lastorder_com_sell
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
double lots_order_buy2(string 木_0,string 木_1)
{
double 子_do_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderType()==0 && OrderMagicNumber()==magic && OrderSymbol()==木_0 && OrderComment()==木_1)
{
子_do_1=OrderLots()+子_do_1;
}
}
return(子_do_1);
}
//lots_order_buy2
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
double lots_order_sell2(string 木_0,string 木_1)
{
double 子_do_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderType()==1 && OrderMagicNumber()==magic && OrderSymbol()==木_0 && OrderComment()==木_1)
{
子_do_1=OrderLots()+子_do_1;
}
}
return(子_do_1);

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderType()==1 && OrderMagicNumber()==magic && OrderSymbol()==木_0 && OrderComment()==木_1)
{
子_do_1=OrderLots()+子_do_1;
}
}
return(子_do_1);

}
//lots_order_sell2
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
double yingkui(string 木_0)
{
int 子_in_1;
double 子_do_2;

//—————————-

for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==0 || OrderType()==1) && OrderSymbol()==木_0 && OrderMagicNumber()==magic)
{
子_do_2=子_do_2+OrderProfit();
}
}
return(子_do_2);
}
//yingkui
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
bool RectLabel(const string 木_0,const int 木_1,const int 木_2,const int 木_3,const int 木_4,const color 木_5,const int 木_6,const int 木_7,const color 木_8,const int 木_9,const int 木_10)
{
int 子_in_1;
int 子_in_2;

//—————————-

if(ObjectFind(0,木_0)==-1)
{
ObjectCreate(0,木_0,OBJ_RECTANGLE_LABEL,0,0,0.0);
ObjectSetInteger(0,木_0,OBJPROP_BACK,0);
ObjectSetInteger(0,木_0,OBJPROP_SELECTABLE,0);
ObjectSetInteger(0,木_0,OBJPROP_SELECTED,0);
ObjectSetInteger(0,木_0,OBJPROP_HIDDEN,1);
ObjectSetInteger(0,木_0,OBJPROP_ZORDER,0);
ObjectSetInteger(0,木_0,OBJPROP_XSIZE,木_3);
ObjectSetInteger(0,木_0,OBJPROP_YSIZE,木_4);
ObjectSetInteger(0,木_0,OBJPROP_BGCOLOR,木_5);
ObjectSetInteger(0,木_0,OBJPROP_BORDER_TYPE,木_6);
ObjectSetInteger(0,木_0,OBJPROP_CORNER,木_7);
ObjectSetInteger(0,木_0,OBJPROP_COLOR,木_8);
ObjectSetInteger(0,木_0,OBJPROP_STYLE,木_9);
ObjectSetInteger(0,木_0,OBJPROP_WIDTH,木_10);
}
ObjectSetInteger(子_in_1,木_0,OBJPROP_XDISTANCE,木_1);
ObjectSetInteger(子_in_1,木_0,OBJPROP_YDISTANCE,木_2);
ObjectSetInteger(子_in_1,木_0,OBJPROP_XSIZE,木_3);
ObjectSetInteger(子_in_1,木_0,OBJPROP_YSIZE,木_4);
return(true);
}
//RectLabel
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
bool Button3(string 木_0,int 木_1,int 木_2,int 木_3,int 木_4,int 木_5,string 木_6,int 木_7,string 木_8,color 木_9,color 木_10,color 木_11)
{
int 子_in_1;
int 子_in_2;

//—————————-

if(ObjectFind(0,木_0)==-1)
{
ObjectCreate(0,木_0,OBJ_BUTTON,0,0,0.0);
ObjectSetInteger(0,木_0,OBJPROP_STATE,0);
}
ObjectSetInteger(子_in_1,木_0,OBJPROP_XDISTANCE,木_1);
ObjectSetInteger(子_in_1,木_0,OBJPROP_YDISTANCE,木_2);
ObjectSetInteger(子_in_1,木_0,OBJPROP_XSIZE,木_3);
ObjectSetInteger(子_in_1,木_0,OBJPROP_YSIZE,木_4);
ObjectSetInteger(子_in_1,木_0,OBJPROP_CORNER,木_5);
ObjectSetString(子_in_1,木_0,OBJPROP_TEXT,木_6);
ObjectSetString(子_in_1,木_0,OBJPROP_FONT,木_8);
ObjectSetInteger(子_in_1,木_0,OBJPROP_FONTSIZE,木_7);
ObjectSetInteger(子_in_1,木_0,OBJPROP_COLOR,木_9);
ObjectSetInteger(子_in_1,木_0,OBJPROP_BGCOLOR,木_10);
ObjectSetInteger(子_in_1,木_0,OBJPROP_BORDER_COLOR,木_11);
ObjectSetInteger(子_in_1,木_0,OBJPROP_BACK,0);
ObjectSetInteger(子_in_1,木_0,OBJPROP_SELECTABLE,0);
ObjectSetInteger(子_in_1,木_0,OBJPROP_SELECTED,0);
ObjectSetInteger(子_in_1,木_0,OBJPROP_HIDDEN,1);
ObjectSetInteger(子_in_1,木_0,OBJPROP_ZORDER,0);
ObjectSetInteger(子_in_1,木_0,OBJPROP_WIDTH,0);
return(true);
}
//Button3
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
bool RectLabel3(string 木_0,int 木_1,int 木_2,int 木_3,int 木_4,int 木_5,color 木_6,color 木_7,int 木_8,int 木_9)
{
int 子_in_1;
int 子_in_2;

//—————————-

ObjectCreate(0,木_0,OBJ_RECTANGLE_LABEL,0,0,0.0);
ObjectSetInteger(0,木_0,OBJPROP_BACK,0);
ObjectSetInteger(0,木_0,OBJPROP_SELECTABLE,0);
ObjectSetInteger(0,木_0,OBJPROP_SELECTED,0);
ObjectSetInteger(0,木_0,OBJPROP_HIDDEN,1);
ObjectSetInteger(0,木_0,OBJPROP_ZORDER,0);
ObjectSetInteger(0,木_0,OBJPROP_XSIZE,木_3);
ObjectSetInteger(0,木_0,OBJPROP_YSIZE,木_4);
ObjectSetInteger(0,木_0,OBJPROP_BGCOLOR,木_6);
ObjectSetInteger(0,木_0,OBJPROP_BORDER_TYPE,0);
ObjectSetInteger(0,木_0,OBJPROP_CORNER,木_5);
ObjectSetInteger(0,木_0,OBJPROP_COLOR,木_7);
ObjectSetInteger(0,木_0,OBJPROP_STYLE,木_8);
ObjectSetInteger(0,木_0,OBJPROP_WIDTH,木_9);
ObjectSetInteger(0,木_0,OBJPROP_XDISTANCE,木_1);
ObjectSetInteger(0,木_0,OBJPROP_YDISTANCE,木_2);
ObjectSetInteger(0,木_0,OBJPROP_XSIZE,木_3);
ObjectSetInteger(0,木_0,OBJPROP_YSIZE,木_4);
return(true);
}
//RectLabel3
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
void idisplay(string 木_0,string 木_1,int 木_2,int 木_3,int 木_4,int 木_5,string 木_6,color 木_7)
{

//—————————-

ObjectDelete(木_0);
ObjectCreate(木_0,OBJ_LABEL,0,0,0.0,0,0.0,0,0.0);
ObjectSetText(木_0,木_1,木_5,木_6,木_7);
ObjectSet(木_0,OBJPROP_CORNER,木_2);
ObjectSet(木_0,OBJPROP_XDISTANCE,木_3);
ObjectSet(木_0,OBJPROP_YDISTANCE,木_4);
}
//idisplay
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
void idisplay2(string 木_0,string 木_1,int 木_2,int 木_3,int 木_4,int 木_5,string 木_6,color 木_7)
{

//—————————-

idisplay(木_0,木_1,木_2,木_3,木_4,木_5,木_6,木_7);
ObjectSet(木_0,1036,1.0);
ObjectSetInteger(0,木_0,OBJPROP_ANCHOR,1);
}
//idisplay2
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
datetime time_last(string 木_0,bool &木_1)
{
long 子_lo_1;
int 子_in_2;

//—————————-

for(子_in_2=HistoryTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_HISTORY)!=false))
break;
if((OrderType()==0 || OrderType()==1) && OrderSymbol()==木_0 && OrderMagicNumber()==magic)
{
子_lo_1=OrderCloseTime();
if(!(OrderProfit()<0.0))
break;
木_1=true;
break;
}
}
return(子_lo_1);
}

//+——————————————————————+
//| |
//+——————————————————————+
double pro_his()
{
double 子_do_1;
int 子_in_2;

//—————————-

for(子_in_2=HistoryTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_HISTORY)!=false))
break;
if((OrderType()==0 || OrderType()==1) && OrderMagicNumber()==magic)
{
子_do_1=子_do_1+OrderProfit();
}
}
return(子_do_1);
}
//pro_his
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
double pro_order()
{
double 子_do_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==0 || OrderType()==1) && OrderMagicNumber()==magic)
{
子_do_1=子_do_1+OrderProfit();
}
}
return(子_do_1);
}
//pro_order
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
void closeall_all()
{
int 子_in_1;
int 子_in_2;
int 子_in_3;
bool 子_bo_4;

//—————————-

子_in_1=OrdersTotal();
for(子_in_2=子_in_1-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES) != false))
return;
if(OrderMagicNumber()==magic)
{
子_in_3 = OrderType();
子_bo_4 = true;
switch(子_in_3)
{
case 0 :
子_bo_4=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),9),30,0xFFFFFFFF);
break;
case 1 :
子_bo_4=OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),10),30,0xFFFFFFFF);
}
if(子_bo_4==false)
{
Sleep(总_in_84);
}
}
}
}
int chd()
{
int a=0;
chatu(0,”p”,0,15,20,212,308,”::Experts\\iphe.bmp”,”::Experts\\iphe.bmp”,0);
return a;
}
//closeall_all
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
bool cheakorders_all()
{
int 子_in_1;
bool 子_bo_2;

//—————————-

子_bo_2=true;
for(子_in_1=OrdersTotal()-1; 子_in_1>=0; 子_in_1=子_in_1-1)
{
if(!(OrderSelect(子_in_1,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if((OrderType()==1 || OrderType()==0) && OrderMagicNumber()==magic)
{
子_bo_2=false;
break;
}
}
return(子_bo_2);
}
//cheakorders_all
//——————— —————————————-

 

//+——————————————————————+
//| |
//+——————————————————————+
void closecondi(string 木_0,double 木_1)
{
double 子_do_1;
double 子_do_2;

//—————————-

子_do_1 = yingkui(木_0);
子_do_2 = 0.0;
子_do_2 = 木_1 * 总_do_53 * 100.0;
if(子_do_1>=子_do_2)
{
while(cheakorders(木_0)==false)
{
closeall(木_0);
}
}
}
//+——————————————————————+
//| |
//+——————————————————————+
void chatu(long chart_ID,string name,int sub_window,int x,int y,int chang,int gao,string file_on,string file_off,int jiaodu)
{
ResetLastError();
ObjectCreate(chart_ID,name,OBJ_BITMAP_LABEL,sub_window,0,0);
ObjectSetString(chart_ID,name,OBJPROP_BMPFILE,0,file_on);
ObjectSetString(chart_ID,name,OBJPROP_BMPFILE,1,file_off);
ObjectSetInteger(chart_ID,name,OBJPROP_XDISTANCE,x);
ObjectSetInteger(chart_ID,name,OBJPROP_YDISTANCE,y);
ObjectSetInteger(chart_ID,name,OBJPROP_XSIZE,chang);
ObjectSetInteger(chart_ID,name,OBJPROP_YSIZE,gao);
ObjectSetInteger(chart_ID,name,OBJPROP_XOFFSET,0);
ObjectSetInteger(chart_ID,name,OBJPROP_YOFFSET,0);
ObjectSetInteger(chart_ID,name,OBJPROP_STATE,false);
ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,CORNER_LEFT_UPPER);
ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,ANCHOR_LEFT_UPPER);
ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clrRed);
ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,STYLE_SOLID);
ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,1);
ObjectSetInteger(chart_ID,name,OBJPROP_BACK,false);
ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,false);
ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,false);
ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,true);
ObjectSetInteger(chart_ID,name,OBJPROP_CORNER,jiaodu);
ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,0);
}
//closecondi
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
bool zhouwu(string 木_0)
{
bool 子_bo_1;

//—————————-

if(!(总_bo_50) && DayOfWeek()==5 && total(木_0)==0)
{
子_bo_1=true;
}
return(子_bo_1);
}
//zhouwu
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
double lastorder_com_buy(string 木_0)
{
double 子_do_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderMagicNumber()==magic && OrderType()==0 && OrderSymbol()==木_0)
{
子_do_1=OrderOpenPrice();
break;
}
}
return(子_do_1);
}
//lastorder_com_buy
//——————— —————————————-

//+——————————————————————+
//| |
//+——————————————————————+
double lastorder_com_sell(string 木_0)
{
double 子_do_1;
int 子_in_2;

//—————————-

for(子_in_2=OrdersTotal()-1; 子_in_2>=0; 子_in_2=子_in_2-1)
{
if(!(OrderSelect(子_in_2,SELECT_BY_POS,MODE_TRADES)!=false))
break;
if(OrderMagicNumber()==magic && OrderType()==1 && OrderSymbol()==木_0)
{
子_do_1=OrderOpenPrice();
break;
}
}
return(子_do_1);
}

//+——————————————————————+
//| |
//+——————————————————————+
void pojie_5()
{
double 子_1_do;
double 子_2_do;
double 子_3_do;
double 子_4_do;
double 子_5_do;
//—– —–
string 临_st_1;
bool 临_bo_2=false;
int 临_in_3;
int 临_in_4;
string 临_st_5;
int 临_in_6;
int 临_in_7;
int 临_in_8;
bool 临_bo_9;
double 临_do_10;

if(!(临_bo_2))
return;
子_1_do = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,SLPeriod,1)) ;
子_2_do = iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,SLPeriod,1)) ;
子_3_do = NormalizeDouble(子_2_do,Digits) ;
if(子_3_do>Bid – MinSL * PointX * Point) //25pt
{
子_3_do = Bid – MinSL * PointX * Point ;
}
else
{
if(子_3_do<Bid – MaxSL * PointX * Point)
{
子_3_do = Bid – MaxSL * PointX * Point ;
}
}
子_3_do = NormalizeDouble(子_3_do,Digits) ;
子_4_do = NormalizeDouble(子_1_do – 子_2_do + 子_1_do,Digits) ;
子_5_do = 0.0 ;
if(Lots<=0.0)
{
子_5_do = InitLots ;
}
else
{
子_5_do = MathMin(MarketInfo(Symbol(),25),MathMax(MarketInfo(Symbol(),23),Lots / 4523452 * AccountEquity())) ;
}
子_5_do = NormalizeDouble(子_5_do,2) ;
临_in_3 = MAGIC;
临_in_4 = 0;
临_st_5 = Symbol();
临_in_6 = 0;
for(临_in_7 = OrdersTotal() – 1 ; 临_in_7 >= 0 ; 临_in_7=临_in_7 – 1)
{
if(!(OrderSelect(临_in_7,SELECT_BY_POS,MODE_TRADES)) || OrderSymbol() != 临_st_5
|| OrderMagicNumber() != 临_in_3 || OrderType() != 临_in_4)
continue;
临_in_6=临_in_6 + 1;

}

if(临_in_6 != 0)
return;
临_in_8 = 0;
临_bo_9 = false;
临_do_10 = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,Period(),1));
if(iClose(Symbol(),0,1) – iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,Period(),1))>TrendGap * PointX * Point)
{
临_bo_9 = true;
}
if(临_in_8 == 1 && 临_do_10 – Close[1]>TrendGap * PointX * Point)
{
临_bo_9 = true;
}
if(!(临_bo_9) || !(pojie_9(0)) || !(Bid<PointX * 2 * Point + Close[1])
|| !(MarketInfo(Symbol(),13)<Spread)
|| OrderSend(Symbol(),OP_BUY,子_5_do,Ask,3,子_3_do,子_4_do,16,MAGIC,0,Blue) >= 0)
return;
Print(“OrderSend Error”,GetLastError());
}
//pojie_5 <<==——– ——–
void pojie_6()
{
double 子_1_do;
double 子_2_do;
double 子_3_do;
double 子_4_do;
double 子_5_do;
//—– —–
string 临_st_1;
bool 临_bo_2=false;
int 临_in_3;
int 临_in_4;
string 临_st_5;
int 临_in_6;
int 临_in_7;
bool 临_bo_8;

临_st_1 = StringFormat(“%02d”,StopHour) + “:” + StringFormat(“%02d”,StopMinute);
if(((StringCompare(TimeToString(TimeCurrent(),TIME_MINUTES),StringFormat(“%02d”,StartHour)
+ “:” + StringFormat(“%02d”,StartMinute),true) >= 0
&& StringCompare(TimeToString(TimeCurrent(),TIME_MINUTES),临_st_1,true) <= 0)
|| (StringCompare(StringFormat(“%02d”,StartHour) + “:” + StringFormat(“%02d”,StartMinute),临_st_1,true) > 0
&& ((StringCompare(TimeToString(TimeCurrent(),TIME_MINUTES),StringFormat(“%02d”,StartHour)
+ “:” + StringFormat(“%02d”,StartMinute),true) >= 0
&& StringCompare(TimeToString(TimeCurrent(),TIME_MINUTES),”23:59″,true) <= 0)
|| (StringCompare(TimeToString(TimeCurrent(),TIME_MINUTES),”00:00″,true) >= 0
&& StringCompare(TimeToString(TimeCurrent(),TIME_MINUTES),临_st_1,true) <= 0)))))
{
临_bo_2 = true;
}
if(!(临_bo_2))
return;
子_1_do = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,SLPeriod,1)) ;
子_2_do = iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,SLPeriod,1)) ;
子_3_do = NormalizeDouble(子_1_do,Digits) ;
if(子_3_do<MinSL * PointX * Point + Bid)
{
子_3_do = MinSL * PointX * Point + Bid ;
}
else
{
if(子_3_do>MaxSL * PointX * Point + Bid)
{
子_3_do = MaxSL * PointX * Point + Bid ;
}
}
子_3_do = NormalizeDouble(子_3_do,Digits) ;
子_4_do = NormalizeDouble(子_2_do – (子_1_do – 子_2_do),Digits) ;
子_5_do = 0.0 ;
if(Lots<=0.0)
{
子_5_do = InitLots ;
}
else
{
子_5_do = MathMin(MarketInfo(Symbol(),25),MathMax(MarketInfo(Symbol(),23),Lots / 4532452 * AccountEquity())) ;
}
子_5_do = NormalizeDouble(子_5_do,2) ;
临_in_3 = MAGIC;
临_in_4 = 1;
临_st_5 = Symbol();
临_in_6 = 0;
for(临_in_7 = OrdersTotal() – 1 ; 临_in_7 >= 0 ; 临_in_7=临_in_7 – 1)
{
if(!(OrderSelect(临_in_7,SELECT_BY_POS,MODE_TRADES)) || OrderSymbol() != 临_st_5 || OrderMagicNumber() != 临_in_3 || OrderType() != 临_in_4)
continue;
临_in_6=临_in_6 + 1;

}
if(临_in_6 != 0)
return;
临_bo_8 = false;
iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,Period(),1));
if(iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,Period(),1)) – Close[1]>TrendGap * PointX * Point)
{
临_bo_8 = true;
}
if(!(临_bo_8) || !(pojie_9(1)) || !(Bid>Close[1] – PointX * 2 * Point) || !(MarketInfo(Symbol(),13)<Spread)
|| OrderSend(Symbol(),OP_SELL,子_5_do,Bid,3,子_3_do,子_4_do,61,MAGIC,0,Red) >= 0)
return;
Print(“OrderSend Error”,GetLastError());
}
//pojie_6 <<==——– ——–
void asd3454567()
{
double 子_1_do;
double 子_2_do;
double 子_3_do;
double 子_4_do;
double 子_5_do;
//—– —–
int 临_in_1;
int 临_in_2;
string 临_st_3;
int 临_in_4;
int 临_in_5=0;
int 临_in_6;
int 临_in_7;
string 临_st_8;
double 临_do_9;
double 临_do_10;
int 临_in_11;
double 临_do_12;
int 临_in_13;
int 临_in_14;
string 临_st_15;
int 临_in_16;
int 临_in_17=0;

子_1_do = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,OSCPeriod,1)) ;
子_2_do = iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,OSCPeriod,1)) ;
子_3_do = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,OSCPeriod,2)) ;
子_4_do = iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,OSCPeriod,2)) ;
子_5_do = 100.0 ;
if(子_1_do – 子_2_do>0.0)
{
子_5_do = (子_1_do – Close[1]) * (-100.0) / (子_1_do – 子_2_do) ;
}
if(子_5_do==100.0)
return;

if(Close[1]>子_3_do && 子_5_do> -(DirectCloseLevel)) //-12
{
临_in_1 = MAGIC;
临_in_2 = 0;
临_st_3 = Symbol();
int w1=9;
while(w1>8)
{
w1=0;
for(临_in_4 = OrdersTotal() – 1 ; 临_in_4 >= 0 ; 临_in_4=临_in_4 – 1)
{
if(!(OrderSelect(临_in_4,SELECT_BY_POS,MODE_TRADES)) || OrderSymbol() != 临_st_3 || OrderMagicNumber() != 临_in_1 || OrderType() != 临_in_2)
continue;

if(!(OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),0,Yellow)))
{
临_in_5 = 0;
w1=1;
break;
}
临_in_5 = 1;
w1=1;
break;

}
if(w1==0)
临_in_5 = 0;
}
if(!(临_in_5))
return;
return;
}
临_in_6 = MAGIC;
临_in_7 = 0;
临_st_8 = Symbol();
临_do_9 = 0.0;
临_do_10 = 0.0;
for(临_in_11 = OrdersTotal() – 1 ; 临_in_11 >= 0 ; 临_in_11=临_in_11 – 1)
{
if(!(OrderSelect(临_in_11,SELECT_BY_POS,MODE_TRADES)) || OrderSymbol() != 临_st_8 || OrderMagicNumber() != 临_in_6
|| OrderType() != 临_in_7)
continue;
临_do_9 = OrderProfit() + OrderSwap() + OrderCommission();
临_do_10 = 临_do_10 + OrderLots();

}
if(临_do_10>0.0)
{
临_do_12 = 临_do_9 / 临_do_10;
}
else
{
临_do_12 = 0.0;
}
if(!(临_do_12>ProfitPoint * 10.0))
return; //20
临_in_13 = MAGIC;
临_in_14 = 0;
临_st_15 = Symbol();
int w2=9;
while(w2>8)
{
w2=0;
for(临_in_16 = OrdersTotal() – 1 ; 临_in_16 >= 0 ; 临_in_16=临_in_16 – 1)
{
if(!(OrderSelect(临_in_16,SELECT_BY_POS,MODE_TRADES)) || OrderSymbol() != 临_st_15
|| OrderMagicNumber() != 临_in_13 || OrderType() != 临_in_14)
continue;

if(!(OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),0,Yellow)))
{
临_in_17 = 0;
w2=1;
break;
}
临_in_17 = 1;
w2=1;
break;

}
if(w2==0)
临_in_17 = 0;
}
if(!(临_in_17))
return;
}

void sads()
{
double 子_1_do;
double 子_2_do;
double 子_3_do;
double 子_4_do;
double 子_5_do;
//—– —–
int 临_in_1;
int 临_in_2;
string 临_st_3;
int 临_in_4;
int 临_in_5;
int 临_in_6;
int 临_in_7;
string 临_st_8;
double 临_do_9;
double 临_do_10;
int 临_in_11;
double 临_do_12;
int 临_in_13;
int 临_in_14;
string 临_st_15;
int 临_in_16;
int 临_in_17=0;

子_1_do = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,OSCPeriod,1)) ;
子_2_do = iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,OSCPeriod,1)) ;
子_3_do = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,OSCPeriod,2)) ;
子_4_do = iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,OSCPeriod,2)) ;
子_5_do = 100.0 ;
if(子_1_do – 子_2_do>0.0)
{
子_5_do = (子_1_do – Close[1]) * (-100.0) / (子_1_do – 子_2_do) ;
}
if(子_5_do==100.0)
return;

if(Close[1]<子_4_do && 子_5_do<DirectCloseLevel – 100.0)
{
临_in_1 = MAGIC;
临_in_2 = 1;
临_st_3 = Symbol();
int w1=9;
while(w1>8)
{
w1=0;
for(临_in_4 = OrdersTotal() – 1 ; 临_in_4 >= 0 ; 临_in_4=临_in_4 – 1)
{
if(!(OrderSelect(临_in_4,SELECT_BY_POS,MODE_TRADES)) || OrderSymbol() != 临_st_3 || OrderMagicNumber() != 临_in_1 || OrderType() != 临_in_2)
continue;

if(!(OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),0,Yellow)))
{
临_in_5 = 0;
w1=1;
break;
}
临_in_5 = 1;
w1=1;
break;

}
if(w1==0)
临_in_5 = 0;
}
if(临_in_5)
{
}
}
临_in_6 = MAGIC;
临_in_7 = 1;
临_st_8 = Symbol();
临_do_9 = 0.0;
临_do_10 = 0.0;
for(临_in_11 = OrdersTotal() – 1 ; 临_in_11 >= 0 ; 临_in_11=临_in_11 – 1)
{
if(!(OrderSelect(临_in_11,SELECT_BY_POS,MODE_TRADES)) || OrderSymbol() != 临_st_8 || OrderMagicNumber() != 临_in_6 || OrderType() != 临_in_7)
continue;
临_do_9 = OrderProfit() + OrderSwap() + OrderCommission();
临_do_10 = 临_do_10 + OrderLots();

}
if(临_do_10>0.0)
{
临_do_12 = 临_do_9 / 临_do_10;
}
else
{
临_do_12 = 0.0;
}
if(!(临_do_12>ProfitPoint * 10.0))
return;
临_in_13 = MAGIC;
临_in_14 = 1;
临_st_15 = Symbol();
int w2=9;
while(w2>8)
{
w2=0;
for(临_in_16 = OrdersTotal() – 1 ; 临_in_16 >= 0 ; 临_in_16=临_in_16 – 1)
{
if(!(OrderSelect(临_in_16,SELECT_BY_POS,MODE_TRADES)) || OrderSymbol() != 临_st_15 || OrderMagicNumber() != 临_in_13 || OrderType() != 临_in_14)
continue;

if(!(OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),0,Yellow)))
{
临_in_17 = 0;
w2=1;
break;
}
临_in_17 = 1;
w2=1;
break;

}
if(w2==0)
临_in_17 = 0;
}
if(!(临_in_17))
return;
}

bool pojie_9(int 木_0_in)
{
bool 子_2_bo = false;
double 子_3_do;
double 子_4_do;
double 子_5_do;
double 子_6_do;
double 子_7_do;
//—– —–

子_3_do = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,OSCPeriod,1)) ;
子_4_do = iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,OSCPeriod,1)) ;
子_5_do = iHigh(Symbol(),0,iHighest(Symbol(),0,MODE_HIGH,OSCPeriod,2)) ;
子_6_do = iLow(Symbol(),0,iLowest(Symbol(),0,MODE_LOW,OSCPeriod,2)) ;
子_7_do = 100.0 ;
if(子_3_do – 子_4_do>0.0)
{
子_7_do = (子_3_do – Close[1]) * (-100.0) / (子_3_do – 子_4_do) ;
}
if(子_7_do==100.0)
{
return(false);
}
if(木_0_in == 0 && 子_5_do – Close[1]>OSCGap * PointX * Point && 子_7_do<OSCLevel – 100.0 && Close[1]<子_6_do)
{
子_2_bo = true ;
}
if(木_0_in == 1 && Close[1] – 子_6_do>OSCGap * PointX * Point && 子_7_do> -(OSCLevel) && Close[1]>子_5_do)
{
子_2_bo = true ;
}
return(子_2_bo);
}
//<<==pojie_9 <<==

//+——————————————————————+

如果你对文件有了解,请帮助投票!

If you are familiar with the file, please help vote!

平均评分 5 / 5. 投票数: 1

到目前为止还没有投票!成为第一位投票人。

相关资源

2 条评论

  • qasim ali 游客

    The link does not show the download button and the provided code is also not working.

    巴基斯坦
    回复
    • admin

      Hello, the download link has been updated.

      新加坡
      回复