Would you help a poor wannabe coder?
|
|||
|
Hi guys
I'm trying to learn how to code and so far being able to change some code already written with some success. Now I'm trying to write something from scratch. I'm starting with something simple but the darn code seems to be wrong and I'm stuck here is the code int init() { return(0); } int start() { double Lowerline; double Upperline; Lowerline = iEnvelopes(NULL,0,8,MODE_SMA, 0,Bid,0.1,MODE_UPPER, 0); Lowerline = iEnvelopes(NULL,0,8,MODE_SMA, 0,Bid,0.1,MODE_LOWER, 0); if(Bid > Upperline) PlaySound("upperline.wav"); if (Bid < Lowerline) PlaySound( "lowerline.wav"); return(0); } My goal is to have the playsound triggered when price crosses the upperline of the envelope and stop when it goes back below the upperline Same thing with the lowerline, playsound triggered when it is below the lowerline on envelope and stop when it goes above It is my understanding that the "if" on my code would do it but it is not hapenning. The upperline wave sound is triggered doesn't matter where price is. Any help will be really appreciated!!
|
|
|
|
|||
|
Quote:
|
|
|||
|
Quote:
First I made a stupid mistake writing lowerline twice.... !!But after reading your post I realized that I was actually stating "Bid" as a variable value and as a price reference for my "if" making it a worthless conditional. I changed the iENVELOPES "Bid" to CLOSE_PRICE and guess what? It works!! Thanks gain for the help!! Last edited by Davietrader; 06-10-2010 at 11:52 PM. |
|
|||
|
Well spotted, glad you got it sorted out
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| looking for EA coder | forexweb | System Coding | 5 | 09-04-2012 03:30 PM |
| Looking for a MT4 Coder? | KaMpeR | Classified Ads | 1 | 05-18-2006 03:00 AM |
All times are GMT. The time now is 11:28 PM.
Registered members gain free access to online FOREX currency trading tools, foreign exchange software, Metatrader MT4/MT5 expert advisors, MT4 indicators and EAs. Register now







!!



Linear Mode

