| 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 |
|
|||
|
I have another simple questio, that I can't solve.
I would like to open multiposition for every signal that I receive. Exactly I would like to open 3 position for every signal, what's the code to do this. Regards
__________________
I'm studing to become an MQL Programmer! ![]() The best strategy to use ForexKiller. Try it: http://forex-killerallday.blogspot.com/ |
|
|||
|
problem with [i]
hi
in my EA , I try to print my two variables but it's not working: ************************************************** ******** double m_10 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, Current + 0); double m_20 = iMA(NULL, 0, 20, 0, MODE_SMA, PRICE_CLOSE, Current + 0); for(int i=1; i<500 ; i--) { m_10[i] = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, Current + i); m_20[i] = iMA(NULL, 0, 20, 0, MODE_SMA, PRICE_CLOSE, Current + i); Print(m_10[i]+ " " + m_20[i]); } ************************************************** ******** this is the message error : '[' assignment expected Help please!! Thanks in advance. |
|
|||
|
Quote:
double m_10[]; double m_20[]; 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 |
|
||||
|
This will do it.
If it's only for the print function, no arrays needed. If you need it for drawing lines, you need something else to activate the buffers. and the for() function needs to count up, not down. ************************************************** ******** int Current; double m_10 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, Current + 0); double m_20 = iMA(NULL, 0, 20, 0, MODE_SMA, PRICE_CLOSE, Current + 0); for(int i=1; i<500 ; i++){ m_10 = iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, Current + i); m_20 = iMA(NULL, 0, 20, 0, MODE_SMA, PRICE_CLOSE, Current + i); Print(m_10+ " " + m_20); } ************************************************** ******** |
|
|||
|
Quote:
Robert |
|
|||
|
Variable problem
Hi,
I am currenty programming an expert which does calculations based on the OHLC of the previous bar. My problem is this: I have a variable called "var5". For the first bar that is counted, var5 is the open of that bar. For every subsequent bar, var5 is the value of var5 on the previous bar, divided by 2. I have no idea how to code this into MQL, and was wondering if anyone could show me an example of how this might be done? Thanks in advance for any replies. |
|
|||
|
only buy, no sell
creating a profitable ea, but it could be twice as good (maybe) for now only buys are placed, never sellorders.
Anyone knows why? //+------------------------------------------------------------------+ //| Signal Begin | //+------------------------------------------------------------------+ double sig_buy = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 0, 0); double sig_sell = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 1, 0); double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1); if (sig_buy>0 && Sg>0) Order = SIGNAL_BUY; if (sig_sell>0 && Sg<0 ) Order = SIGNAL_SELL; //+------------------------------------------------------------------+ //| Signal End | //+------------------------------------------------------------------+ |
|
||||
|
publish the total code, there is another thing wrong...
the second step is perhaps your iCustom() functions. Quote:
|
|
|||
|
Hi, does anyone know if MQL4 supports placing an indicator object into the future and viewing the future object? I tried ObjectMove to a future date (no error return), but the display stops at the last tick date. Thanks
|
![]() |
| Bookmarks |
| Tags |
| candle time, CHinGsMAroonCLK, coders guru, expert advisor, forex, how to code, I_XO_A_H, mechanical trading, trading |
| 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 07: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 05:22 PM |