Indicator Help needed for iteration function section!

Hey, am making an indicator that counts the total (bid) tick size up (and down for another indicator window) at rate of per n seconds…in the “indicator iteration function” I couldnt find funtions that work for this formula (I tried “BidPrice - LastBidPrice” for Range function but there are other wrong codings in that section…

Prt 2 (the part that needs fixing)

Not sure I understood the scenario completely. Can’t visualize it well. If you can list an example it’d help. Does the code compile successfully? If any compiling errors would help to know which line and position.

If you were counting x ticks in n seconds you’d probably want to consider using MQLtick() data structure and store any of the tick data in an array (ArraySetAsSeries) and count the # of instances in array. Variable ArraySize for nx will probably be required in this case too. Atleast this is the approach I’d take initially.

Strongly recommend heading over to the MQL4 forums and asking more experienced coders there. I don’t think I’m doing a good job understanding your requirement.

Used to seeing EAs coded within the OnTick() event handlers because I’m more familiar with MQL5. Dunno if Start () makes a difference or does the same thing. E.g.

void OnTick()
  {
   MqlTick last_tick;
//---
   if(SymbolInfoTick(Symbol(),last_tick))
     {
      Print(last_tick.time,": Bid = ",last_tick.bid,
            " Ask = ",last_tick.ask,"  Volume = ",last_tick.volume);
     }
   else Print("SymbolInfoTick() failed, error = ",GetLastError());
//---
  }
1 Like

thnkx u gave a pretty great direction👍🏼
(the indicator is simply like the ATR except it counts the total added tick sizes UP nd DOWN - per n seconds

1 Like

thanks for sharing

I got some good information. I think we need to trade with the trend every time.

1 Like

Good information? Plz share :slightly_smiling_face:

There are some moments to follow to manage the forex market. For example, bearish trend, bullish trend, ranging area. In these 3 types of the market situation, I need to understand how market sentiment is working.

Yes, but what does this have to do with the coding problem?

Although it has nothing to do with coding problems, the issues in my topic are very important.

Any advice can be relevant to any topic. You can give advice on marriage and say it’s important. But that doesn’t mean you go about spamming topics with random and unrelated advice.