Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
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;
Yes, you can use GetMaxLot(OP_BUY,OP_BUY); to get the maxlot for buy open trade only, and GetMaxLot(OP_SELL,OP_SELL); to get the maxlot for sell open trade only.
You can make simplify this code "if (max_lot == 0 || OrderLots() >= max_lot)" with "if (OrderLots() > max_lot)"
Coz if max_lot = 0 automatically it will be lower than any lot of the open trades. And sign ">=" change with ">" coz if it have same value, no need to update max_lot with the same value, useless effort. It will update only if the new value greater than max_lot.
By changing that code, it could make your process faster.
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 12:15 AM.
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,"",orderc ount,0,Red);
with
OrderSend(Symbol(),OP_SELL,0.1,Bid,3,Ask+Point*10, 0,"",ordercount,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
10 pips may be too close to the broker-imposed stops limit (varies between brokers) - meaning if it's a minimium of 10 pips and price happens to swing 1 pip inside this as the order is being placed, the order will be rejected...
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.
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.
@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)'...