//+------------------------------------------------------------------+ //| SJPTEST.mq4 | //| Copyright 2016, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2016, MetaQuotes Software Corp." #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit() { //---引用RSI值, double a=iRSI(NULL,0,14,PRICE_CLOSE,4); if(a>80) Print("wwww",a); double b=iRSI(NULL,0,14,PRICE_CLOSE,0); if(b>40) Print("qqq",b); //---引用KD名額 ,傳回目前柱對應随機振蕩名額的K值 double c=iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0); Print("cccc",c); //---可以用此名額判斷買入、賣出時機。 //--- return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { //--- } //+------------------------------------------------------------------+ //| Expert tick function | //+------------------------------------------------------------------+ void OnTick() { //---
double a=iRSI(NULL,0,14,PRICE_CLOSE,1); Print("",a); } //+------------------------------------------------------------------+