| 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 |
|
|||
|
Hi folks, anyone know how to add the custom indicator below into an expert advisor ? So that we no need use the icustom to call it from the file ?
Code:
//+------------------------------------------------------------------+
//| ARSI.mq4
//+------------------------------------------------------------------+
#property copyright "Alexander Kirilyuk M."
#property link ""
#property indicator_separate_window
//#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
extern int ARSIPeriod = 14;
//---- buffers
double ARSI[];
int init()
{
string short_name = "ARSI (" + ARSIPeriod + ")";
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ARSI);
//SetIndexDrawBegin(0,ARSIPeriod);
return(0);
}
int start()
{
int i, counted_bars = IndicatorCounted();
int limit;
if(Bars <= ARSIPeriod)
return(0);
if(counted_bars < 0)
{
return;
}
if(counted_bars == 0)
{
limit = Bars;
}
if(counted_bars > 0)
{
limit = Bars - counted_bars;
}
double sc;
for(i = limit; i >= 0; i--)
{
sc = MathAbs(iRSI(NULL, 0, ARSIPeriod, PRICE_CLOSE, i)/100.0 - 0.5) * 2.0;
if( Bars - i <= ARSIPeriod)
ARSI[i] = Close[i];
else
ARSI[i] = ARSI[i+1] + sc * (Close[i] - ARSI[i+1]);
}
Print ("Try2 : " , ARSI[0], ":", ARSI[1]);
return(0);
}
|
|
|||
|
Quote:
iCustom(Symbol(),0,"ARSI",ARSIPeriod,0,0); The number in red is the bar you want to look at. Change it as you need. 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 |
|
|||
|
Quote:
|
|
||||
|
improvement of 10points3
Hi everyone.
We are trying to improve 10points3. We need to change the code to close last third trade. Please refer to the last posts here: 10points 3.mq4. We are getting good results here. |
|
|||
|
suspend order
Hello folks,
with respect to programming in MQL4 I'm a real newbie, but I'm learning every day. Currently I'm trying the following: in the main loop of my EA, when certain conditions are met, an order is opened. This order is with a given entry, stoploss and takeprofit using the OrderSend function. Only one order at the time is allowed: total = OrdersTotal(); if(total < 1) { etc etc What I'd like to build is that when the order's stoploss or takeprofit is hit, the EA waits with taking new orders until the current hourly bar (the bar within the stoploss or takeprofit is hit) finishes. The problem at the moment is that as soon as the stoploss or takeprofit is hit, immediately another order is taken in the main loop. Can you guys please help me out ? FXX |
![]() |
| 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 | |