| 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 | Thread Tools | Display Modes |
|
|||
|
help with my expert advisor
I'm trying to program my first expert advisor..
And I want to use 2 indicators. -- MACD and Stochastic.. I want to use them on 2 different time periods. -- The MACD on daily chart (iMACD(1440,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0)) and the Stochastic on 1 hour chart (iStochastic(60,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)). I want to set the buying and selling signals using the results of those two indicators. In back-testing, I'm supposed to establish the period of back-testing -- And I cannot choose both daily chart for MACD and also hourly chart for Stochastic. If I'm using back-testing on the Daily chart, MetaTrader loads both the MACD and the Stochastic with daily parameters (AND I DON'T KNOW WHY...), and thus, I cannot use different time periods. -- I have tested the stochastic with both the 60 minutes time interval and 1440 time interval and obtained the same resuts ( Does anyone know: 1. How I can perform back-testing for 2 different time periods for the 2 indicators I want to use in my EA? 2. If I'm using this kind of expert advisor in forward testing, when comparing the results of the indicator, MetaTrader shall use the time periods stated by me in the EA code, or it shall use the time period of the chart the EA is set on? |
|
|||
|
Quote:
Function call is wrong. The first parameter is the currency pair and the second parameter is the time frame. The defaults are NULL-Current chart (first parameter) and 0-current chart time frame (second parameter). Change your code, iMACD(1440,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0) iStochastic(60,0,5,3,3,MODE_SMA,0,MODE_MAIN,0) To iMACD(NULL,1440,12,26,9,PRICE_CLOSE,MODE_MAIN,0) iStochastic(NULL,60,5,3,3,MODE_SMA,0,MODE_MAIN,0) Hope it helps. |
|
|||
|
Quote:
It seems it's working.. (I mean, -- I get different results .. if I use the daily and hourly charts) but the .. the EA still loses money.. --- I need to learn more to make it work. Thank you |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| RSI Expert Advisor | TF2K | Suggestions for Trading Systems | 4 | 03-21-2007 12:52 PM |
| 50-34 Expert advisor | geisebhum | Suggestions for Trading Systems | 4 | 12-20-2006 05:45 PM |
| CCI Expert Advisor | rodrigokaus | Expert Advisors - Metatrader 4 | 10 | 09-29-2006 06:31 PM |
| expert advisor ? | swirly | Expert Advisors - Metatrader 4 | 3 | 08-30-2006 07:04 AM |
| What Expert Advisor are they using? | fikko | Expert Advisors - Metatrader 4 | 4 | 07-01-2006 08:47 AM |