| 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 |
|
|||
|
Paging MR PIP
I am new to this coding stuff. I was wondering how to replace this line of code with the LSMA. Could you help me with this task.
Trend = iMA(Symbol(), TrendTimeFrame, TrendPeriods, 0, MODE_LWMA, PRICE_CLOSE, 0); // PrevTrend = iMACD(Symbol(), PERIOD_M1, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 1); With this line of code from your LSMA_ MCAD_EMA mq4. //+------------------------------------------------------------------------+ //| LSMA - Least Squares Moving Average function calculation | //| LSMA_In_Color Indicator plots the end of the linear regression line | //+------------------------------------------------------------------------+ double LSMA(int Rperiod, int shift) { int i; double sum; int length; double lengthvar; double tmp; double wt; length = Rperiod; sum = 0; for(i = length; i >= 1 ; i--) { lengthvar = length + 1; lengthvar /= 3; tmp = 0; tmp = ( i - lengthvar)*Close[length-i+shift]; sum+=tmp; } wt = MathFloor(sum*6/(length*(length+1))/Point)*Point; return(wt); } Or do I have to do something else to make this work? Last edited by i2trader; 09-20-2008 at 06:45 PM. Reason: to clarify the statement. |
|
||||
|
Quote:
Trend = LSMA(int Rperiod, int shift); ?
__________________
You need proffesional mql coder? Contact me! I will help you! ........................................ http://www.fxservice.eu/ ........................................ |
|
|||
|
Hi ,
I have one question. When we have one open order we use the OrderModify function to trailing stop the order. In this case we modify the stoploss of the order. Could is possible to modify the takeprofit target of one open order with OrderModify function? OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Blue); In my case I have one open order which has one sell position open and I have take profit for example when the EURUSD currency. If we say my take profit target is 1.4010 but my currency goes near to take profit target but the order does not closes and then the trend is reversing and I loose my order by stop loss. You will say , if you trailstop your order you will take the smaller profit. But is it possible to change OrderTakeProfit variable to be smaller for example 1 pip so if my currency reaches the 1.4009 and never go to 1.4010 , how do I change take profit target in runtime and make it 1.4008 to take the profit. Not trailing stop. Thank you very much. ![]() |
|
|||
|
help me please!
can you help me to create simple EA:
the rules: pair :GBPUSD timeframe:15menit take profit:15 pips stoploss :15 pips lots :0.1 open order: sellstop(-15) and buystop(+15) from price_open in current candle EA will open order every 15 menit,when price_open=price_high=price_low any body help me? |
|
|||
|
That's quite a simple EA, why not try and write it yourself?
Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV ![]() ForexArea.com Users of Gap Trader from 'Forex-Assistant' MUST Read This |
|
|||
|
Compare OrderOpenTime() of each order and close the oldest.
Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV ![]() ForexArea.com Users of Gap Trader from 'Forex-Assistant' MUST Read This |
![]() |
| 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 |