new to coding, need help - page 2

To add comments, please log in or register
J4str
27
J4str  

I need help with another counter.  What i want is if price has gone above the moving average and stayed above the moving average. Then the indicator has switched from bullish to bearish and back to bullish. I want the new condition to trigger every time the indicator becomes bullish while staying above the moving average.  



I feel like it should be something like this, but i don't think its right:  


  double ma;
 int  ContinuationCounterBull=0; 
  for(int i = 1; i < Bars - 1 && !_StopFlag;i++){
     ma = iCustom(NULL, 0,"icustom\\Kijun-sen.ex4",BaselineLength,BaselineShift,0,i);
      if(Close[i] > ma && PrimaryEntry==1 && PrimaryEntry1==0)
         BaselineCounterBull++;
         if(Close[i] < ma) break;
      }  

With Primary==1 means that it is currently long and PrimaryEntry1==0  Means that PrimaryEntry was Short 1 candle ago

Pavel Shutovskiy
76502
Pavel Shutovskiy  
Documentation on MQL5: Language Basics
Documentation on MQL5: Language Basics
  • www.mql5.com
The MetaQuotes Language 5 (MQL5) is an object-oriented high-level programming language intended for writing automated trading strategies, custom technical indicators for the analysis of various financial markets. It allows not only to write a variety of expert systems, designed to operate in real time, but also create their own graphical tools...
J4str
27
J4str  



thanks. Im trying.  I'm sure you just read the manual and then were instantly an expert and never had any struggles as you learned

Pavel Shutovskiy
76502
Pavel Shutovskiy  
J4str:



thanks. Im trying.  I'm sure you just read the manual and then were instantly an expert and never had any struggles as you learned

I as well as you study every day, read the terms and make them correctly and then it will be easier for me to help you

12
To add comments, please log in or register