| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack (2) | Thread Tools | Display Modes |
|
|||
|
how to add alert to tis indicator?
i hv got an MA crossover indicator which work really well, but it doesn't hv the sound alert support tat make me miss a lot of trade, can u please teach me how to add alert to tis indicator as I know nothing about the meta code thing....thanks...
here is the code for the indicator together wif the indicator itself, thanks... /*[[ Name := EMA Cross Author := Hapsa Link := http://www.metaquotes.net/ Separate Window := No Separate Window := No First Color := Red First Draw Type := Symbol First Symbol := 108 Use Second Data := Yes Second Color := DarkOliveGreen Second Draw Type := Symbol Second Symbol := 108 ]]*/ #property copyright "Hapsa" #property link "" extern int SlowPeriod=20; extern int FastPeriod=5; #property indicator_buffers 3 #property indicator_chart_window #property indicator_color1 Red #property indicator_color2 Green double L20[]; double L50[]; double shift=0,val1=0,val2=0; int init() { IndicatorBuffers(3); SetIndexStyle(0,DRAW_ARROW); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(0, 108); SetIndexArrow(1, 108); SetIndexBuffer(0,L20); SetIndexBuffer(1,L50); //---- indicators //---- return(0); } int start() { int counted_bars=IndicatorCounted(); //---- int i = Bars - counted_bars - 1; while (i>=0) { val1=0; val2=0; double iMaSlowPrevious = iMA(NULL,0,SlowPeriod,0,MODE_EMA, PRICE_CLOSE, i-1); double iMaSlowCurrent = iMA(NULL,0,SlowPeriod,0,MODE_EMA, PRICE_CLOSE, i); double iMaFastPrevious = iMA(NULL,0,FastPeriod,0,MODE_EMA, PRICE_CLOSE, i-1); double iMaFastCurrent = iMA(NULL,0,FastPeriod,0,MODE_EMA, PRICE_CLOSE, i); if (iMaFastPrevious<iMaSlowPrevious && iMaFastCurrent>iMaSlowCurrent ) val1=High[i]; if (iMaFastPrevious>iMaSlowPrevious && iMaFastCurrent<iMaSlowCurrent ) val2=Low[i]; L20[i]=val1+5*Point; L50[i]=val2-5*Point; i--; } //---- return(0); } |
|
|||
|
stoploss issue
Hello,
I'm new to all this forex/metatrading but am trying to understand how it all works. Now I am trying to write an EA and I'm afraid I'm missing something fundamental. If, in my code, I replace OrderSend(Symbol(),OP_SELL,0.1,Bid,3,0,0,"",MAGIC, 0,Red); with OrderSend(Symbol(),OP_SELL,0.1,Bid,3,Ask+Point*10, 0,"",MAGIC,0,Red); And test this new version out in the strategy tester, I get LESS orders. How can adding a stoploss diminish the number of order entries? I can imagine that the number rises in the case that adding a stop order causes orders to exit more early and thus new orders can be added more quickly, but LESS orders...? Any idea? Thanks Last edited by azertyken2; 09-11-2008 at 01:15 AM. |
|
|||
|
Quote:
|
|
|||
|
PHP Code:
Right now, both Color(s) 1 & 2 show 'black' on the graph!! Can any expert Guru help me solve this issue??? Thanks in Advance! |
|
|||
|
Quote:
color Color2; FerruFx
__________________
THE HEART of FOREX & THE PROBABILITY METER - Trade with 100% confidence and ... Stress Less!!! Coding services: Experts Advisors, indicators, alerts, etc ... more info by PM NEW: video presentation of the Probability Meter ... 24hrs action on the website |
|
|||
|
Please can someone explain to me how can I get rid of an "OrderModify error 1" problem. I been looking and it seams I need to NormalizeDouble(), but I've normalized everything from here to the moon and still I'm getting the error.
Once I understand it I think I'll be able to figure it out, please can someone help. thanks. I'm also getting an "unmatched data error(volume limit 31 at 2008.04.16 07:30 exceeded)" if any one knows what that's all about I'd appreciate the help. |
|
|||
|
SetIndexStyle(0,DRAW_ARROW,0,star_size,color Color1);
SetIndexStyle(1,DRAW_ARROW,0,star_size,color Color2); I tried inserting color all over the place, one step and trial at a time, and either I get an error for the above two statements - ')' - comma or semicolon expected or no error, but then everything shows black. This really confuses me - Any more suggestions?? Dave |
|
|||
|
@xerof123 - this error occurs when you try to modify an order with the same values the open order already has. The other problem is price mis-matches between the different timeframes - to get rid of them, delete and regenerate all tick data via the History Center menu.
@Dave137 - where to begin, you have color1, color2 defined as type string, whereas these are of type color. Note that 'color1' keyword in the 'properties' definition is just assigning a value, so when you later define color1, color2, they could just as easily be called c1,c2. Further note that you do not need to use 'properties color1' to begin with as you are setting them manually in the init() function anyway. Also, check other indicators on how to use of '#property indicator buffers x' and 'indicatorbuffers(x)'... |
![]() |
| Bookmarks |
| Tags |
| histogram, forex, ZUP_v1.mq4 |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/questions/270-ask.html
|
||||
| Posted By | For | Type | Date | |
| OzFx System:) - Page 639 | This thread | Refback | 06-21-2008 10:53 PM | |
| Forex SRDC Sidus Sibkis EA MT4 Forum OTCSmart | This thread | Refback | 12-08-2007 12:46 PM | |