How do I make the indicator draw a straight line at a level and reset every day?

 

An indicator that shows some of the important levels...

Guys I've been trying to make my own indicator, but I can't even make a line work properly...

I don't just need an indicator.. I want to learn how to  do this <Deleted>... So first of all: does anybody know of any online resources where they explain how to make indicators, and not EAs??

Second... maybe somebody can just explain to me....

I tried to make a line in an indicator, that would represent the low of the day, and basically just be a straight, horisontal line that would be drawn at the lowest point of the current day, and basically start over the next day... (obviously I'd like to do more than this, but if I know this simple thing, I would be able to get on with my life)...

This is my code(inside the OnCalculate function:

int candles_to_check = iBarShift(Symbol(),Period(),iTime(NULL,PERIOD_D1,0));
   int lowestCandlaOfTheDay = iLowest(Symbol(),0,MODE_LOW,candles_to_check,0);
   
   double lowOfToday = iLow(Symbol(),0,lowestCandlaOfTheDay);
   
   for(int i=0; i < candles_to_check; i++)
     {
      lowOfTodayBuffer[i] = lowOfToday;

     }

Now I thought the the iBarShift would reset to zero at the beginning of each day, as it does when I make and EA, but it just keeps on growing, and in any case, I don't know if it would help if it would reset... the line basically keeps on being drawn and never resets, and it just registers the lower lows for each new day...


Please help me! :)

Documentation on MQL5: Language Basics / Functions / Event Handling Functions
Documentation on MQL5: Language Basics / Functions / Event Handling Functions
  • www.mql5.com
Event Handling Functions - Functions - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5