That code is so messy, I can't be bothered to try to work out what you are trying to do.
kancrase: I usually like to use for(i=limit-1; i>=0; i--) for calculation, rather than (i=0; i<limit; i++).
Babel
Babel
:
Babel
Babel
:
1. I want to change to i-- style or I want to know why its not working with i--.
2. I want to see the text on the chart while back testing.
3. I want to see the changes on the chart when I changed and compiles.
- Always count down. Contradictory information on IndicatorCounted() - MQL4 forum. Don't look past bars
int counted_bars=IndicatorCounted(); if(counted_bars<0) return(-1); if(counted_bars < 4) counted_bars = 4; // Lookback High_4=High[i+4]; for(i=Bars -1 -counted_bars; i>=0; i--)
You probably do NOT want to process bar zero: for(...; i>0; ...) ObjectCreate("Bullish_Engulfing"+i, OBJ_TEXT, 0, Time[i+2], Low[i+1]);
First time you create say "Bullish_Engulfing1." A few bars later you find a new one and try to AGAIN create "Bullish_Engulfing1." That fails: Objects must be uniquely named. Use
"Bullish_Engulfing"+Time[i]
Check your return codes What are Function return values ? How do I use them ? - MQL4 forum Since the text objects is placed t Time[i+2] shouldn't it be named with that? Don't keep repeating the create code - make it a function - simply your code.
- Learn to use bools properly
bool Morning_Star(){if(// condition )return(true);else return(false);}//(true)
bool Morning_Star(){ return( condition );}
- I want to see the text on the chart while back testing.The tester is for testing EA's not indicators. You have to put a dummy EA (at least) on the chart and then drag the indicator on to the chart.
- I want to see the changes on the chart when I changed and compiles.No problem there, except in the tester, you have stop the test.
WHRoeder:
Yes! it fixed all problems I was dealing with. Thank you for your answers and advice. It is very helpful!

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I was making the candlestick price pattern indicator, but the text (supposed to be created by ObjectCreate) didn't show while back testing.
(it does show when I simply apply on the chart.)
I also noticed my indicator doesn't really update by just compiling.
(The other indicators, I can see the changes on the chart immediately when I compiles)
So I have to delete this indicator and put it again to check the changes I made.
I usually like to use for(i=limit-1; i>=0; i--) for calculation, rather than (i=0; i<limit; i++).
but if I use for(i=limit-1; i>=0; i--) on this cahrt, the text (created by ObjectCreate) doesn't show on the chart at all.
I think all of those problem are some what related to the fact I couldn't code with (i=limit-1; i>=0; i--) style (or not).
Could you help me with my code?
1. I want to change to i-- style or I want to know why its not working with i--.
2. I want to see the text on the chart while back testing.
3. I want to see the changes on the chart when I changed and compiles.
Thank you.