| 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 |
|
|||
|
Quote:
Just for information: we are having few very good threads with templates to create EAs and indicators. For example: Templates to create EAs and Indicators: - some good templates are here; - templates with some new codes are here. - Programming Modules with many programming functions are here. - function of "mql4 code": thread with codes. To use those templates and to create your own EA so you will need some very preliminary knowledge and it is basicly related to this thread http://www.forex-tsd.com/general-dis...der-forex.html If you don't want to do some routine coding so you may automate this job: use this EA builder Expert Advisor Builder for MetaTrader 4 (it is free) and use this program Forex Trading with Gordago Forex Broker - Best Forex Software for Creating Forex Trading System! (I bought it for $9 long time ago - don't know about the price now). But to use those builders so you will need this thread first with Codersguru lessans http://www.forex-tsd.com/general-dis...der-forex.html |
|
|||
|
Good Day
i'am learning mql4 and have difficulties to understand some functions example: Code:
for( shift=limit; shift>=0; shift--)
{
double RSI = iRSI(NULL,0,RSILength,PRICE_CLOSE,shift);
SmRSI[shift]= SmRSI[shift+1] + 2./(Smooth+1)*(RSI - SmRSI[shift+1]);
if(SmRSI[shift] > SmRSI[shift+1]) {double hRSI = SmRSI[shift]; double lRSI = SmRSI[shift+1];}
else
if(SmRSI[shift] < SmRSI[shift+1]) {hRSI = SmRSI[shift+1]; lRSI = SmRSI[shift];}
else
{hRSI = SmRSI[shift]; lRSI = SmRSI[shift];}
ATRRSI[shift] = hRSI - lRSI;
Code:
SmRSI[shift]= SmRSI[shift+1] + 2./(Smooth+1)*(RSI - SmRSI[shift+1]); PS: it's a pîece of code from Igorad trendstrength indi. Thnaks |
|
|||
|
Custom Pricemode
Does anyone know how to make a custom pricemode ? I am using the following alert to signal when the price (extern int PriceMode = 6; //(high+low+close+close)/4) crosses a MA. I would like to make this custom by adding an offset, say 1 or 2 %. Is this possible ? Something like:
extern int PriceMode = ((high+low+close+close)/4) * 1.01 ---------------------------------------------------- #property indicator_chart_window extern int MA1.period =5; //Period 5 extern int MA1.shift=0; extern int MA1.method=2; //SMMA extern int lMA1.price=2; //MA set to candle high extern int sMA1.price=3; //MA set to candle low extern int PriceMode = 6; //(high+low+close+close)/4 int cBar,pBarLong,pBarShort; int start() { cBar = Time[0]; if(CheckMACross(1)== 1 && cBar!=pBarLong ) {EmailAlert(1); pBarLong=cBar;} else if(CheckMACross(2)==-1 && cBar!=pBarShort) {EmailAlert(2); pBarShort=cBar;} return(0); } int CheckMACross(int mode) { if(mode==1) int price = lMA1.price; else if(mode==2) price = sMA1.price; double price1 = iMA(Symbol(),0,1,0,1,PriceMode,1); double ma1 = iMA(Symbol(),0,MA1.period,MA1.shift,MA1.method, price,1); double price0 = iMA(Symbol(),0,1,0,1,PriceMode,0); double ma0 = iMA(Symbol(),0,MA1.period,MA1.shift,MA1.method, price,0); if(ma1 > price1 && ma0 <= price0) return( 1); else if(ma1 < price1 && ma0 >= price0) return(-1); else return(0); } { if(mode == 1) SendMail("Signal for LONG",Symbol()+" Go Long"); //SendMail else if(mode == 2) SendMail("Signal for SHORT",Symbol()+" Go Short");//SendMail } int lastBAlert = 0; int lastSAlert = 0; void EmailAlert(int mode) { if(mode == 2 && lastSAlert < Time[0] ) { SendMail("Go Short 1",Symbol()+" Go Short 1"); //SendMail lastSAlert = Time[0]; } } Last edited by cochran1; 10-16-2007 at 09:36 PM. |
|
|||
|
source code help!
Hello all
I have an EA and i want to add an input to it If take profit >= :xx , buy :xx lot extern int Deltaopen1 =100; I wrote; if (type == OP_BUY) { if (M2.BuyCnt == 0 && OrderTakeProfit() > OrderOpenPrice() + Deltaopen1*point) { Buy(Symbol(), GetLots2(), Ask, 0, 0, Magic2); return; } } if (type == OP_SELL) { if (M2.SellCnt == 0 && OrderTakeProfit() <= OrderOpenPrice() - Deltaopen1*point) { Sell(Symbol(), GetLots2(), Bid, 0, 0, Magic2); return; } } } But it does not work, I appreciate any help. Thank you |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
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 |