i am new tried to code this what happened . i just need signal during crossover and not automated trading . can some one help me to finish this. please

 
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                  
double  StocSlow;
double  StocFast;
double  StocSlow1;
double  StocFast1;
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
 void stochastics()
 {
 double  StocSlow=iStochastic(NULL,0,14,3,3,MODE_SIGNAL,0,MODE_SIGNAL,1); //Slow Stochastic 
 double  StocFast=iStochastic(NULL,0,14,3,3,MODE_SMA,0,MODE_MAIN,1); //Fast Stochastic---------------------------------+
 double  StocSlow1=iStochastic(NULL,0,14,3,3,MODE_SIGNAL,0,MODE_SIGNAL,0);
 double  StocFast1=iStochastic(NULL,0,14,3,3,MODE_SMA,0,MODE_MAIN,0);
 {
 if((StocSlow>StocFast)&&(StocSlow1<StocFast1))
 {
   Print("buy == Symbol()");
   Alert("buy symbol(),price:",Ask);
  }
  return;
   }
 if((StocSlow<StocFast)&&(StocSlow1>StocFast1))
 {
   Print("sell symbol()");
   Alert("sell symbol(),price:",Ask);
   }
   return;
   }
Discover new MetaTrader 5 opportunities with MQL5 community and services
Discover new MetaTrader 5 opportunities with MQL5 community and services
  • www.mql5.com
Ask questions on technical analysis, discuss trading systems and improve your MQL5 programming skills to develop your own trading strategies. Communicate and share your experience with traders from anywhere in the world, answer questions and help beginners —...
 
arunkumar96:

i am new

tried to code this what happened .

i just need signal during crossover and not automated trading

can some one help me to finish this. please

  1. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your (original) post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  2. What happened?

  3. That's nice.

  4. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using CODE button) and state the nature of your problem.
              No free help
              urgent help.

  5. Your stochastics() function is never called in OnCalculate().

  6. double  StocSlow;
    double  StocFast;
    double  StocSlow1;
    double  StocFast1;
    void stochastics(){
       double  StocSlow=
       double  StocFast=
       double  StocSlow1=
       double  StocFast1=
    Fix your warnings.
 

 program got compiled but i see a sad smiley

checked expert advisor setting

alert settings

dll imports allowed

//+------------------------------------------------------------------+
//|                                             stochastic cross.mq4 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                  
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
 void start()
 {
 double  StocSlowprev=iStochastic(NULL,0,14,3,3,MODE_SMA,0,MODE_SIGNAL,1); //Slow Stochastic 
 double  StocFastprev=iStochastic(NULL,0,14,3,3,MODE_SMA,0,MODE_MAIN,1); //Fast Stochastic---------------------------------+
 double  StocSlowcurr=iStochastic(NULL,0,14,3,3,MODE_SMA,0,MODE_SIGNAL,0);
 double  StocFastcurr=iStochastic(NULL,0,14,3,3,MODE_SMA,0,MODE_MAIN,0);
 {
 if((StocSlowprev>StocFastprev)&&(StocSlowcurr<StocFastcurr))
 {
   Print("buy", Symbol());
   Alert("buy ,Symbol(),price:",Ask);
  }
  return;
   }
 if((StocSlowprev<StocFastprev)&&(StocSlowcurr>StocFastcurr))
 {
   Print("sell",Symbol());
   Alert("sell",Symbol(),Ask);
   }
   return;
   }
 
Do you want to run this as indicator or as expert advisor? You need to make up your mind. And depending on this, you have either OnCalculate() or OnTick() function to define. Also, OnInit() should be defined, it is missing in your code.
 
Before you want to write a code you should study the MQL language, Help and mql samples to see how it works, what are the basics etc.  
Reason: