| 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 |
|
|||
|
A simple question (i hope that): I have a buy position with trailing stop. I want to open a sell position when the open position hit the trailing stop, but the sell position must be open in the same price that the buy position close:
let me explain: trailing stop:1.3075 buy orde:1.3080 if the buy order hit 1.3075, then the EA must open a short position at 1.3075 The problem is that the trailing is moving and i have to modified the open of sellstop acording to the triling movement. I don{t know how can i code that Please, help me. Thanks in advance |
|
|||
|
Does MQL4 support pass by reference in the function? I want to return 2 values from the same function. Instead of writing all the code within start(), I want to create a function just to make the code cleaner and more easy to read. Can anyone point me to any previous EA that is using this type of technique or give me a one liner example?
I am familiar with programming in C/C++ but new to the MQL4 language. Any help is appreciated. Thanks in advance. ![]() |
|
|||
|
newbie Question
Dear All
I have an Ea That is working well. But I think that some parameters are not optimized. All the parameters are putted in arrays: Array1[0] = "EURUSD";/Currency Array2[0] = 60;//ime frame Arra3[0]= 20;//Parameter1 Array[4]=xx;//Parameter 2 What I need is to put thoses value as extern parameter that I can optimize them in back testing. How to procced. A sample code is highly appreciated. i Tried to put extern int par1= 60 and Arra3[0]= par1; i've got par1 is not initialized. Thanks for your help. Kindest Regards |
|
|||
|
Quote:
extern string Par1 = "20,30,40,50"; Then you'll have int arrays. int _par1[10]; Then you need function to parse the line and store everything in _par1[] variable that will be used in your program. I copied some code from my indicator: int line_cnt = 0; double params[10]; string names[10]; int parse_line(string line){ int len = StringLen(line), i = 0, startPos = 0, par = -1; if(len < 6) return(0); string str; while(i <= len){ if(len == i || StringGetChar(line, i) == sep1){ par++; str = StringSubstr(line, startPos, i-startPos); if(par < 6) params[line_cnt][par] = StrToInteger(str); else if(par == 6) names[line_cnt] = str; else{ if(StringFind(str, "false") != -1) nPar[line_cnt][par-6] = 0; else if(StringFind(str, "true") != -1) nPar[line_cnt][par-6] = 1; else nPar[line_cnt][par-6] = StrToDouble(str); } i++; startPos = i; } i++; } //nPar[line_cnt][0] = par-6; } which can be used this way: parse_line("Hehe,10,203,40,5.34"); |
|
|||
|
I posted this on another forum, but still have yet to figure this out:
Hi everyone. I'm trying to code a simple MTF stochastic cross indicator, but I'm having a few problems. I used Scorpion's '3 MAs Cross Arrows' indicator as the base and modified it for stochastics (thank you Scorpion!). Basically I want to have 2 stochastics; one for the current time frame and one for the 4 hour. If the current time frame stochastic turns up and the 4 hour stochastic is turned up, an arrow will be placed. If the current time frame stochastic turns up but the 4 hour stochastic is turned down, an arrow will not be placed. The indicator I've attatched draws the arrows, however it will draw buy arrows when the 4 hour is turned down, and vice versa. I appreciate any help! |
|
||||
|
Can someone explain what Point means in MT4/MQL?
For example - in FX what would be the point value for EUR/USD? What about USD/JPY? Would it be .0001 for EUR and .01 for JPY? How about index futures? What would be a point for ES, ER2, YM? .25, .10, 1? Sorry I am trying to figure out exactly what it means by point because it seems more like it really means pip for FX or tick for futures. There is a big difference between point and tick though. Thanks.
__________________
TraceJ |
![]() |
| 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 | |