Forex



Go Back   Forex Trading > Programming > MetaTrader
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
Thread Tools Display Modes
  #1861 (permalink)  
Old 06-24-2009, 05:04 AM
dznmrd's Avatar
Senior Member
 
Join Date: May 2008
Location: Mumbai, Maharastra
Posts: 158
dznmrd is on a distinguished road
Quote:
Originally Posted by yingli View Post
I start this tread for getting some help here.I am learnig to code for the indicator attached .however it did not work out.Could anybody help? It is a very reliable indicator and if somebody could make a EA for it .it is almost a holy grail.tia.

Basic priciple is:
1.open Sell position when red arrow appear,
2open buy position when white arrow appear and automaticly close all th esell position/positions.
3.apply for any timeframe .
4.no stop loss,
5.add order function.

Loking forward to response!





//+------------------------------------------------------------------+
//| IINWMARROWS.mq4 |
//| Based on EMA_CROSS.mq4 |
//| Copyright ?2006, MetaQuotes Software Corp. |
//| Forex Trading Software: Forex Trading Platform MetaTrader 4 |
//| Last little modified by Iin Zulkarnain |
//+------------------------------------------------------------------+
#property copyright "Copyright ?2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
//----
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 Red
#property indicator_width1 2
#property indicator_width2 2
//----
double CrossUp[];
double CrossDown[];
extern int FasterMode=3; //0=sma, 1=ema, 2=smma, 3=lwma
extern int FasterMA= 3;
extern int SlowerMode=3; //0=sma, 1=ema, 2=smma, 3=lwma
extern int SlowerMA= 3;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0, DRAW_ARROW, EMPTY);
SetIndexArrow(0, 233);
SetIndexBuffer(0, CrossUp);
SetIndexStyle(1, DRAW_ARROW, EMPTY);
SetIndexArrow(1, 234);
SetIndexBuffer(1, CrossDown);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit, i, counter;
double fasterMAnow, slowerMAnow, fasterMAprevious, slowerMAprevious, fasterMAafter, slowerMAafter;
double Range, AvgRange;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
//----
limit=Bars-counted_bars;
for(i=0; i<=limit; i++)
{
counter=i;
Range=0;
AvgRange=0;
for(counter=i ;counter<=i+9;counter++)
{
AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
}
Range=AvgRange/10;
fasterMAnow=iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i);
fasterMAprevious=iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i+1);
fasterMAafter=iMA(NULL, 0, FasterMA, 0, FasterMode, PRICE_CLOSE, i-1);
//----
slowerMAnow=iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i);
slowerMAprevious=iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i+1);
slowerMAafter=iMA(NULL, 0, SlowerMA, 0, SlowerMode, PRICE_OPEN, i-1);
if ((fasterMAnow > slowerMAnow) && (fasterMAprevious < slowerMAprevious) && (fasterMAafter > slowerMAafter))
{
CrossUp[i]=Low[i] - Range*0.5;
}
else if ((fasterMAnow < slowerMAnow) && (fasterMAprevious > slowerMAprevious) && (fasterMAafter < slowerMAafter))
{
CrossDown[i]=High[i] + Range*0.5;
}
}
return(0);
}
//+------------------------------------------------------------------+this thread for learning how to code properly,I am learning to code for
Could anyone help code an alert for this indicator, its really cool .
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1862 (permalink)  
Old 06-24-2009, 01:18 PM
smb1970's Avatar
Junior Member
 
Join Date: Jan 2009
Posts: 3
smb1970 is on a distinguished road
George's Oscar Calculator - Can anyone code an indicator for it?

Hi Folks,
I don't know if anyone is familiar with Forex Made-EZ by George Smith.
I'm currently reviewing his work and wondered if anyone has coded an indicator for the Oscar oscillator he uses?

The formula is

let A = the highest high of the last eight bars (including this one)
let B = the lowest low of the past eight bars (including this one)
let C = current bars closing price
let X = the previous oscillator figure (Oscar)

Today's "rough" oscillator equals (C-B) divided by (A-B) times 100.

Next we "smooth" our rough number (let's call it Y) like this:

Final oscillator number = ((X divided by 3) times 2), plus (Y divided by 3).

If anyone has either coded this or can code this it would be highly appreciated.

Regards Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1863 (permalink)  
Old 06-27-2009, 02:53 AM
Junior Member
 
Join Date: Sep 2008
Posts: 12
dedreko is on a distinguished road
Inverted Trailing Stop

Hi,

I want some help with an idea.
I'm using trailing stops on my EAs (3 step trailing), but I want to do the inverted thing to protect losses.
I will try to explain:

I open an order, with a initial stop loss.
If the trade go 15 pips in loss direction and come back 10 pips, close the trade (first step).
If the trade go 30 pips in loss direction and come back 15 pips, close the trade (second step).


Something like this.

Thanks for the help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1864 (permalink)  
Old 06-27-2009, 02:59 AM
fosgate_r's Avatar
Member
 
Join Date: Nov 2008
Posts: 91
fosgate_r is on a distinguished road
Quote:
Originally Posted by dedreko View Post
Hi,

I want some help with an idea.
I'm using trailing stops on my EAs (3 step trailing), but I want to do the inverted thing to protect losses.
I will try to explain:

I open an order, with a initial stop loss.
If the trade go 15 pips in loss direction and come back 10 pips, close the trade (first step).
If the trade go 30 pips in loss direction and come back 15 pips, close the trade (second step).


Something like this.

Thanks for the help
This is something new to me.
So, the losing trade closing always need to wait until it bounce back right?
How about if it doen't bounceback?
Will we close at the intial SL?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1865 (permalink)  
Old 06-27-2009, 10:49 PM
Junior Member
 
Join Date: Sep 2008
Posts: 12
dedreko is on a distinguished road
Yes, I want to make 3 steps
Exemple:
Reach 15 and come back 10
Reach 30 and come back 15
Reach 45 and come back 15

Or close at stop loss.
I will take a pic and try to explain better.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1866 (permalink)  
Old 06-28-2009, 09:53 AM
Junior Member
 
Join Date: Sep 2008
Posts: 12
dedreko is on a distinguished road
Quote:
Originally Posted by fosgate_r View Post
This is something new to me.
So, the losing trade closing always need to wait until it bounce back right?
How about if it doen't bounceback?
Will we close at the intial SL?
Thanks by now, I already made it, now trying to optimize to get good results with this loss protection.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1867 (permalink)  
Old 06-30-2009, 04:27 AM
SPACECHIMP's Avatar
Member
 
Join Date: Feb 2006
Location: West Michigan, USA.
Posts: 86
SPACECHIMP is on a distinguished road
I"m trying to find info on plotting a line, just like the RSI indicator for example..I have two numbers I want to plot as lines on the same indicator

I know it will involve an array of some sort but I'm not having luck figuring out what group of code will make this happen.
__________________
www.LiveTeamTrading.com
The FIRST LIVE Team trading Network Community for FOREX TRADERS! Ask me about Getting an Invite!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1868 (permalink)  
Old 06-30-2009, 07:28 AM
Senior Member
 
Join Date: Apr 2008
Location: Rawalpindi
Posts: 106
arshadFX is on a distinguished road
Lightbulb indicator buffer

Quote:
Originally Posted by SPACECHIMP View Post
I"m trying to find info on plotting a line, just like the RSI indicator for example..I have two numbers I want to plot as lines on the same indicator

I know it will involve an array of some sort but I'm not having luck figuring out what group of code will make this happen.
Please read this article

MQL4 Language for Newbies. Custom Indicators (Part 1) - MQL4 Articles
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1869 (permalink)  
Old 06-30-2009, 09:54 AM
smb1970's Avatar
Junior Member
 
Join Date: Jan 2009
Posts: 3
smb1970 is on a distinguished road
Quote:
Originally Posted by smb1970 View Post
Hi Folks,
I don't know if anyone is familiar with Forex Made-EZ by George Smith.
I'm currently reviewing his work and wondered if anyone has coded an indicator for the Oscar oscillator he uses?

The formula is

let A = the highest high of the last eight bars (including this one)
let B = the lowest low of the past eight bars (including this one)
let C = current bars closing price
let X = the previous oscillator figure (Oscar)

Today's "rough" oscillator equals (C-B) divided by (A-B) times 100.

Next we "smooth" our rough number (let's call it Y) like this:

Final oscillator number = ((X divided by 3) times 2), plus (Y divided by 3).

If anyone has either coded this or can code this it would be highly appreciated.

Regards Steve
I've had a go at coding this myself. Could anybody comment on whether this does what I think it does. The values don't quite seem to tally to what they do if I manually calculate the figures. Also, it only starts from the time the indicator is placed. I'd like it to show the historic values as well.

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- buffers
double ExtMapBuffer1[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+

int init()

{

//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
string short_name = "Oscar Indicator";

IndicatorShortName(short_name);
//----
return(1);

}

//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+

int deinit()

{

return(0);

}

//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+

int start()

{

int counted_bars=IndicatorCounted();

//---- check for possible errors
if (counted_bars<0) return(-1);
//---- last counted bar will be recounted
if (counted_bars>0) counted_bars--;

int pos=Bars-counted_bars;

//---- main calculation loop
double x;
x=50;
while(pos>=0)

{

double a, b, c, y, osc;

//let A = the highest high of the last eight bars (including this one)
a=High[iHighest( NULL , 0, MODE_HIGH, 8, pos)];

//let B = the lowest low of the past eight bars (including this one)
b=Low[iLowest( NULL ,0,MODE_LOW,8,pos)];

//let C = current bars closing price
c = Close[pos];

//let X = the previous oscillator figure (Oscar)
//Today's "rough" oscillator equals (C-B) divided by (A-B) times 100.
y=((c-b)/(a-b))*100;

//Next we "smooth" our rough number (let's call it Y) like this:
//Final oscillator number = ((X divided by 3) times 2), plus (Y divided by 3).
osc=((x/3)*2)+(y/3);

ExtMapBuffer1[pos]= osc ;

pos--;

}


return(0);

}

Any help gratefully received.
Thanks Steve
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1870 (permalink)  
Old 06-30-2009, 11:05 AM
Junior Member
 
Join Date: Apr 2006
Posts: 26
Ricx is on a distinguished road
Ask... Mode_trades

hi, can anyone give example for MODE_TRADES use for?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop


Currently Active Users Viewing This Thread: 2 (1 members and 1 guests)
Klondyke
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

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


All times are GMT. The time now is 11:43 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.