[原创]编程高手帮忙看看
1,判断条件如何改成当前蜡烛图的收盘价?
2,在蜡烛图上加箭头怎么弄?
//+------------------------------------------------------------------+
//| Stochastic Alarm v1.mq4 |
//| Copyright ?2007, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property link "http://www.metaquotes.net"
#property indicator_chart_window
//---- input parameters
extern int Stoch1KPeriod =5;
extern int Stoch1DPeriod =3;
extern int Stoch1SlowPeriod =3;
extern bool Stoch1CrossAlarm = true;
extern int Stoch2KPeriod =20;
extern int Stoch2DPeriod =10;
extern int Stoch2SlowPeriod =20;
extern int Stoch3KPeriod =50;
extern int Stoch3DPeriod =10;
extern int Stoch3SlowPeriod =20;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
double Stoch1Signal = iStochastic(Symbol(),0,Stoch1KPeriod,Stoch1DPeriod,Stoch1SlowPeriod,MODE_SMA,0,MODE_SIGNAL,0);
double Stoch1Main = iStochastic(Symbol(),0,Stoch1KPeriod,Stoch1DPeriod,Stoch1SlowPeriod,MODE_SMA,0,MODE_MAIN,0);
double Stoch1SignalCurrent = iStochastic(Symbol(),0,Stoch1KPeriod,Stoch1DPeriod,Stoch1SlowPeriod,MODE_SMA,0,MODE_SIGNAL,1);
double Stoch1SignalPrevious = iStochastic(Symbol(),0,Stoch1KPeriod,Stoch1DPeriod,Stoch1SlowPeriod,MODE_SMA,0,MODE_SIGNAL,2);
double Stoch1MainCurrent = iStochastic(Symbol(),0,Stoch1KPeriod,Stoch1DPeriod,Stoch1SlowPeriod,MODE_SMA,0,MODE_MAIN,1);
double Stoch1MainPrevious = iStochastic(Symbol(),0,Stoch1KPeriod,Stoch1DPeriod,Stoch1SlowPeriod,MODE_SMA,0,MODE_MAIN,2);
double Stoch2SignalCurrent = iStochastic(Symbol(),0,Stoch2KPeriod,Stoch2DPeriod,Stoch2SlowPeriod,MODE_SMA,0,MODE_SIGNAL,1);
double Stoch2MainCurrent = iStochastic(Symbol(),0,Stoch2KPeriod,Stoch2DPeriod,Stoch2SlowPeriod,MODE_SMA,0,MODE_MAIN,1);
double Stoch3SignalCurrent = iStochastic(Symbol(),0,Stoch3KPeriod,Stoch3DPeriod,Stoch3SlowPeriod,MODE_SMA,0,MODE_SIGNAL,1);
double Stoch3MainCurrent = iStochastic(Symbol(),0,Stoch3KPeriod,Stoch3DPeriod,Stoch3SlowPeriod,MODE_SMA,0,MODE_MAIN,1);
if(Stoch1CrossAlarm)
{
if((Stoch2MainCurrent>Stoch2SignalCurrent) && (Stoch3MainCurrent>Stoch3SignalCurrent) && (Stoch1SignalPrevious>Stoch1MainPrevious)&&(Stoch1MainCurrent>Stoch1SignalCurrent)
&& (Stoch1Main>Stoch1Signal))
{
PlaySound("alert.wav");
Print("Cross Up ",Symbol());
} }
if(Stoch1CrossAlarm)
{
if((Stoch2MainCurrent
发表于:2007-11-14 00:55只看该作者
2楼
请把要求说详细一点
判断条件改成收盘价,收盘价达到的条件是什么呢?
在蜡烛图上加箭头,出现箭头的条件又是什么呢?
3楼
谢谢楼上老兄回复。本来是想要做5>3 and 20>10 and 50>10 的时候标记做多箭头(做空相反),但是需要用9个数组,mt4里不能实现,只好作罢了。
韬客社区www.talkfx.co