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
mqlearner:
I will do the print statements as soon as the market is open and I can get some movement on the indy to produce results to test.
Wait for the markets to open! No way. You shouldn't waste valuable debugging time just because the market isn't open, and in any case debugging with the strategy tester is faster because you don't have to wait a minute for a one minute candle to expire. Instant EA to show the idea ...
Run this in the strategy tester using Visual Mode at speed 28 (drag the visual mode slider bar) on an M1 period and you will be able to see the results live. Obviously you can adapt the idea to the debugging your code. The \n in the strings makes a new line.
thank you I appreciate that help...im so frustrated tho...my limited understanding of mql4 is driving me nuts!
I have tried the print statement debuggin and it works perfectly like you suggested (as below) :
But when I add one more criteria like below, then it stops working
all im trying to do here is go from the code you posted earlier that alerts me when the : 15min candle is red and then the 5min candle is blue..
to an alert when the 15min candle is red and the 2nd last 5min candle [2] is blue and the the last 5min candle [1] closed red
its a simple idea to ask the indicator to look for when the 15min is red and the 5min changes from blue to red.
but every time i add the look back to the 2nd last candle [2] on the 5min the indicator goes silent... if I use just the last 5min candle [1] it alerts perfectly.
Im so frustrated, please help me before my head explodes :)
many thanx
Maybe blue5current is not less than red5current ? add a print statement before that line and print the values of blue5current & red5current then you will know.
you should sort your braces too { } so you code is clearer.
My personal preference is this . . .
thanx Raptor, I am certain it is because the indicator that Im calling to get these values plots a blue or red block depending on if the blue or red buffer is greater...
Im simply trying to get an audible alert after the block has been created on the chart...so if the block has been created as red then I am certain the red buffer is greater than the blue buffer.
I hope that makes sense, if I misunderstood your comment please excuse me and explain as to a newbie :)
thanx
maybe a chart example willmake me more understood, i dont think im explaining myself very well. :(
so as long as the blocks are created the buffers are determined, red>blue or blue>red ... please correct me if im wrong.
thanx Raptor, I am certain it is because the indicator that Im calling to get these values plots a blue or red block depending on if the blue or red buffer is greater...
Add a print statement . . . the you will KNOW for certain . . . maybe you are calling the indicator wrong, maybe there is an error in the Indicator . . . maybe, maybe, maybe . . . . add the Print statement and you will KNOW what the values actually are.
ok thanx will do that now, sorry if I seem difficult...I am just frustrated with myself and the code... wi
I will try anything you guys suggest because I am REALLY wanting to get to grips with all this.
thanx for your answers and suggestions.
I will try anything you guys suggest
I have tried the code you suggested...it only prints the first criterias print statement like before have a look :
it just wont do anything if I add a second criteria. its weird.
I have tried the code you suggested...it only prints the first criterias print statement like before have a look :
it just wont do anything if I add a second criteria. its weird.
Thank you for for continued help...
thank you for your advice and hopefully now that Ive got my head around these Print statements I will be able to debug my code much more efficiently..[ and without bother the pro's on this forum :) ]