Indicator not counting zero bar. - MetaQuotes MetaTrader MQL Programming | futures trading

Go Back

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > MetaTrader > MetaQuotes MetaTrader MQL Programming

Indicator not counting zero bar.
Started:June 4th, 2015 (05:37 PM) by Reichenbach Views / Replies:237 / 1
Last Reply:June 4th, 2015 (05:37 PM) Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Indicator not counting zero bar.

Old June 4th, 2015, 05:37 PM   #1 (permalink)
Trading Apprentice
Phoenix Arizona
Futures Experience: Advanced
Platform: MT4
Favorite Futures: Forex
Posts: 1 since Jun 2015
Thanks: 0 given, 0 received

Indicator not counting zero bar.

The crux of the issue is an indicator not counting the zero bar( current bar), but still counting all other bars. To resolve this, you have to manually refresh to get accurate, real time drawing line positioning on the indicator. Now, it works fine in offline charts, but that is only because they are constantly refreshing. I have images to post, but am disallowed by the board.

Here is what I suspect to be part of the issue:
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
if(counted_bars==0) limit-=1+numbars+1;
for(i=0; i<limit; i++)

I've gotten suggestions for this as the solution:
int lookback = numbars + 1;  // for(j<numbars+1) Close[in+j+1]
int limit=Bars - MathMax(lookback, counted_bars);
for(i=limit-1; i>=0; --i)

I've considered something like this:
   if(limit>MaxHistory-1) limit=MaxHistory-1;
It doesn't seem to work however. I'm thinking that perhaps an easier workaround would be an auto-refresh function on a .25 second interval added to the original code? Admittedly, I am an amateur in this field of writing code, but resolving this is a critical piece in keeping my overall strategy semi-automated and expanding it to the world of big money. I greatly appreciate any help.

The indicator is based on the Maximum Entropy Method, you can google it to find it since I can't link it.

Last edited by Reichenbach; June 4th, 2015 at 05:45 PM.
Reply With Quote

Old June 4th, 2015, 05:37 PM   #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.


Reply > Futures Trading, News, Charts and Platforms > Platforms and Indicators > MetaTrader > MetaQuotes MetaTrader MQL Programming > Indicator not counting zero bar.

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

An Afternoon with FIO trader bobwest

Elite only

NinjaTrader 8: Programming Profitable Trading Edges w/Scott Hodson

Elite only

Anthony Drager: Executing on Intermarket Correlations & Order Flow, Part 2

Elite only

Adam Grimes: Five critically important keys to professional trading

Elite only

Machine Learning Concepts w/FIO member NJAMC

Elite only

MarketDelta Cloud Platform: Announcing new mobile features

Dec 1

NinjaTrader 8: Features and Enhancements

Dec 6

Similar Threads
Thread Thread Starter Forum Replies Last Post
Indicator to measure a price bar's tendency to undercut prior bar's high 10handles TradeStation 0 October 25th, 2014 02:53 PM
I need help with a Visual Candle Counting indicator, please. ckajrtx ThinkOrSwim 2 May 15th, 2014 09:30 AM
Heikin Ashi indicator with bar outline same color as bar? Todd NinjaTrader 29 September 7th, 2013 07:33 AM
Looking for a wave counting indicator reno57540 NinjaTrader 1 November 29th, 2012 02:57 PM
Elliot Wave counting indicator praetorian NinjaTrader 2 February 9th, 2012 10:21 PM

All times are GMT -4. The time now is 08:43 AM.

Copyright © 2016 by All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts

Page generated 2016-10-24 in 0.08 seconds with 20 queries on phoenix via your IP