| 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 (1) | Thread Tools | Display Modes |
|
|||
|
Help needed - combining timeframes
I am trying to develop an EA that uses two signals:
1) An EMA based indicator from the D1 chart that indicates the major trend (long, short, or flat) 2) A MACD based indicator from the H4 chart that gives the trading signal (long or short) I have developed both my custom indicators - they work fine in their respective charts. However, I am having difficulty combining them to work together as an EA How do you go about combining timeframes in an EA? Thanks. CelticWarrior72 |
|
|||
|
How to change position sign with 1 command
In mql4 what is the command to change the sign of a position with only one order? I mean, for example, if I'm long on EURUSD of 5000 I want to be short of 5000 with a operation..
Thanks |
|
|||
|
What's wrong with this code?
I'm battling with making my expert advisor do as I tell it to
I'm simply trying to keep hedge ratios roughly even simply put close one Sell in profit at a time then close one Buy in profit at a time and keep alternating my code includes an offset of 5 unhedged positions My girlfriend and I are pulling our hair out! We try as best we can to code this ourselves before we ask for help but we are getting absolutely no where! Many thanks to this forum and to the people that have helped us we gratefully acknowledge, these people have really helped our learning curve |
|
|||
|
Have a look at these
I also struggle with the coding. I keep looking for ea's that do something similar to what I am trying to do.
I have attached some hedging ea's for you to look at. Is the hedge in a different currency? You may have to use MarketInfo() if that is the case. |
|
|||
|
hello to everyone!
// double A = MarketInfo("EURUSD",MODE_BID); doube B = MarketInfo("USDJPY",MODE_BID); double C = MarketInfo("EURJPY",MODE_BID); init() { A = MarketInfo("EURUSD",MODE_BID); B = MarketInfo("USDJPY",MODE_BID); C = MarketInfo("EURJPY",MODE_BID); } int start() { ... } // why does those codes not works? when complies,that comes to so many errors: 'MarketInfo' - initialization expected 'A' - variable not defined ... .....and so on Last edited by wuzuwang; 10-09-2007 at 12:37 AM. |
|
|||
|
This worked for me
Quote:
{ double lots = InitialLots;//default lots 0.1 - there will be no error if lots will not be set by the other part of the code // int total = OrdersHistoryTotal(); for(int i=0;i<OrdersHistoryTotal();i++) // scan all closed / cancelled transactions { OrderSelect(i, SELECT_BY_POS, MODE_HISTORY ); if(OrderSymbol() == Symbol()&& OrderMagicNumber()==MagicNumber) { if(OrderProfit()<0) { lots = NormalizeDouble(OrderLots() * LotsFactor,2); } else { lots=InitialLots; } } } return(lots); } I used this to check if the last closed trade was a winner or not. If not I martingaled the lots. Hope it helps. |
![]() |
| Bookmarks |
| Tags |
| CHinGsMAroonCLK, I_XO_A_H |
| Thread Tools | |
| Display Modes | |
|
|
LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/metatrader-programming/554-how-code.html
|
||||
| Posted By | For | Type | Date | |
| Need an experienced programmer? - Page 2 | Post #0 | Refback | 09-24-2008 06:24 AM | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |