• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 12:07am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 12:07am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

I will code your scalping EAs for no charge 36 replies

I will code your pivot EAs for no charge 18 replies

EAs and indicators relating to moutaki... 22 replies

InterbankFX has loaded its MT4 platform with custom EAs, indicators and scripts 1 reply

Need help to code EAs for MT4 and MT5 2 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 35,977
Attachments: I will code your EAs and Indicators for no charge
Exit Attachments

I will code your EAs and Indicators for no charge

  • Last Post
  •  
  • 1 111112Page 113114115 2619
  • 1 Page 113 2619
  •  
  • Post #2,241
  • Quote
  • May 9, 2013 10:06pm May 9, 2013 10:06pm
  •  fx-trader777
  • Joined Aug 2005 | Status: steady and consistent | 977 Posts
Hi MT

it would be very helpful if you do this for me. This code is based on the following logic to sell GBPUSD or EURJPY after the specific time frame and provided that the price range between this time frame is no more than certain pips, then stop and profit are placed respectfully. But something wrong is here, it doesn't work and backtesting is not accurate. Can you take a look and tell me if I am on right path?

//+------------------------------------------------------------------+
//| simple EA.mq4 |
//| Copyright © 2011, luktom.biz |
//| www.luktom.biz/en |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2011, luktom.biz."
#property link "http://www.luktom.biz"


extern double stopLoss = 30;
extern double takeProfit = 50;
//extern string Begin="00:00";
//extern string End="08:15";
extern int StartHour = 0; // Start Hour of Trade Session
extern int StartMinute= 0; // Start Minute of Trade Session
extern int EndHour = 8; // End Hour of Trade Session
extern int EndMinute = 15; // End Hour of Trade Session
extern double distance = 60;
extern double pipBuffer = 10;
extern bool isECN = true;
extern double lots = 0.1;
extern bool tradesunday=false; // trade on sunday

bool cond = false;
bool cond2 = false;
int magic = 1232344524285020;
int slippage = 1;
string comment = "";
int ticket;
int myDigits = 1 ;
double RangeHigh , RangeLow ;
string theComment = "" , theComment2 = "" ;

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----

//----
if(Digits==5||Digits==3){
stopLoss=stopLoss*10;
takeProfit=takeProfit*10;
distance = distance*10;
pipBuffer = pipBuffer*10;
myDigits = myDigits*10 ;
}

return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
double myDistance = distance*Point ;
int myEndTimeShift = 0 ;

double dt1 = StrToTime(TimeToStr(TimeCurrent(),TIME_DATE) + " " + StartHour + ":" + StartMinute + ":00");
double dt2 = StrToTime(TimeToStr(TimeCurrent(),TIME_DATE) + " " + EndHour + ":" + EndMinute + ":00");

if (dt1 > dt2) dt1 = StrToTime(TimeToStr(TimeCurrent() - 86400, TIME_DATE) + " " + StartHour + ":" + StartMinute + ":00"); //If the StartTime is greater than the EndTime on the same day, the code assumes that the intended start time was 86400 seconds earlier.
if (dt1 > dt2) dt1 -= 86400;

int StartTimeShift = iBarShift(NULL,0,dt1, false);
int EndTimeShift = iBarShift(NULL,0,dt2, false);

if(StartTimeShift!=-1)
{
RangeHigh = iHigh(NULL, 0, iHighest(NULL, 0, MODE_HIGH, (StartTimeShift - EndTimeShift), EndTimeShift));

if(EndTimeShift==0)
{
RangeLow = iLow(NULL, 0, iLowest(NULL, 0, MODE_LOW, (StartTimeShift - EndTimeShift ), EndTimeShift ));
myEndTimeShift = EndTimeShift ;
}else
{
RangeLow = iLow(NULL, 0, iLowest(NULL, 0, MODE_LOW, (StartTimeShift - EndTimeShift +1 ), EndTimeShift + 1 ));
myEndTimeShift = EndTimeShift + 1 ;
}

}

/*Print(" high StartTimeShift " + StartTimeShift + " " + ( iHigh(NULL, 0, StartTimeShift ) ) ) ;
Print(" Low StartTimeShift " + StartTimeShift + " " + ( iLow(NULL, 0, StartTimeShift ) ) ) ;

Print(" high myEndTimeShift " + myEndTimeShift + " " + ( iHigh(NULL, 0, myEndTimeShift ) ) ) ;
Print(" Low myEndTimeShift " + myEndTimeShift + " " + ( iLow(NULL, 0, myEndTimeShift ) ) ) ;
*/

if(TimeCondition())
{
theComment = "Breakout Range - FROM: ["+TimeToStr(dt1)+"] -> TO: ["+TimeToStr(dt2)+"] = " + DoubleToStr( ( (RangeHigh - RangeLow)/ Point / myDigits ), 2 ) +" Pips" ;
theComment2 = "nNO TRADING TIME" ;

}else
{
theComment = "Breakout Range - FROM: ["+TimeToStr(dt1)+"] -> TO: ["+TimeToStr(dt2)+"] = " + DoubleToStr( ( (RangeHigh - RangeLow)/ Point / myDigits ), 2 ) +" Pips" ;
theComment2 = "nNOW IS TRADING TIME!! " ;
}

Comment(theComment+theComment2);


if( (RangeHigh - RangeLow) < myDistance )
{
cond2 = true;
}else
{
cond2 = false;
}

Print(" range " + DoubleToStr( ( (RangeHigh - RangeLow)/ Point / myDigits ), 2 ));

if ( ! TimeCondition() )
{
cond = false;
}

if(!TimeCondition() && cond2 && ( CheckValidOrders() == false) && (DayOfWeek()!=0) )
{

//Print(" range " + DoubleToStr( ( (RangeHigh - RangeLow)/ Point / myDigits ), 2 ));

if(countOrders(magic,OP_SELL) == 0 )
{

if( ( Bid <= RangeLow - (pipBuffer*Point) ) ) // && short == 0
{

if(isECN == false)
{
OrderSend(Symbol(),OP_SELL,lots,Bid, slippage,sltpValue(Ask+ stopLoss*Point,stopLoss) ,sltpValue(Ask- takeProfit*Point,takeProfit),comment,magic);
}
if(isECN)
{
ticket=OrderSend(Symbol(),OP_SELL,lots,Bid, slippage,0,0,comment,magic);
OrderSelect(ticket,SELECT_BY_TICKET);
OrderModify(ticket,OrderOpenPrice(),sltpValue(Ask +stopLoss*Point, stopLoss),sltpValue(Bid- takeProfit*Point,takeProfit),0);
}
}
}
if(countOrders(magic,OP_BUY) == 0)
{

if( ( Ask>= RangeHigh + (pipBuffer*Point) ) )
{
if(isECN==false)
{
OrderSend(Symbol(),OP_BUY,lots,Ask, slippage,sltpValue(Ask - stopLoss*Point, stopLoss),sltpValue(Bid+ takeProfit*Point,takeProfit),comment,magic);
}
if(isECN)
{
ticket=OrderSend(Symbol(),OP_BUY,lots,Ask, slippage,0,0,comment,magic);
OrderSelect(ticket,SELECT_BY_TICKET);
OrderModify(ticket,OrderOpenPrice(),sltpValue(Bid - stopLoss*Point, stopLoss),sltpValue(Ask+ takeProfit*Point,takeProfit),0);
}
}
}

}
//----
return(0);
}
//+------------------------------------------------------------------+

bool TimeCondition()
{
bool result = false;

datetime SessionStart = StrToTime(StartHour+":"+StartMinute);
datetime SessionEnd = StrToTime(EndHour+":"+EndMinute);

if (StartHour < EndHour)
result = TimeCurrent() >= SessionStart && TimeCurrent() < SessionEnd;
else
if (StartHour > EndHour)
result = (TimeCurrent() >= SessionStart && TimeHour(TimeCurrent()) < 24)
||(TimeHour(TimeCurrent()) >= 0 && TimeCurrent() < SessionEnd);

return(result);
}


int countOrders(int oMagic,int oType) {

int count=0;

for(int i=0;i<OrdersTotal();i++) {
if(OrderSelect(i,SELECT_BY_POS)) {
if(OrderMagicNumber()==oMagic) {
if(OrderSymbol()==Symbol()) {
if(OrderType()==oType || oType<0) {
count++;
}
}
}
}
}
return(count);
}

double sltpValue(double w1, int w2)
{
if(w2 == 0)
return (0);
return (NormalizeDouble(w1, Digits));
}


int TotalHistoryOrders() {
int cnt = 0;
int TotalOpenOrders = 0;
cnt=OrdersHistoryTotal();
if(cnt==0) {
return(0);
}
else {
for(;cnt>=0;cnt--) {
RefreshRates();
OrderSelect(cnt,SELECT_BY_POS,MODE_HISTORY);
if(OrderSymbol()==Symbol()) {
TotalOpenOrders++;
}
}
}
return(TotalOpenOrders);
}


bool CheckValidOrders(){

if(TotalHistoryOrders() == 0)
return(false);

int last_order_idx = (TotalHistoryOrders() - 1);

OrderSelect(last_order_idx,SELECT_BY_POS,MODE_HISTORY);
if(TimeDayOfYear(OrderOpenTime()) == TimeDayOfYear(TimeCurrent()) && OrderSymbol() == Symbol()){
return (true);
}

if( TimeDayOfYear(OrderCloseTime()) == TimeDayOfYear(TimeCurrent())
&& TimeDayOfYear(OrderOpenTime()) != TimeDayOfYear(OrderCloseTime()) && OrderSymbol() == Symbol() ){
return (true);
}

return(false);

}
kiss the trend
 
 
  • Post #2,242
  • Quote
  • May 10, 2013 7:18am May 10, 2013 7:18am
  •  RedLineFred
  • Joined Sep 2012 | Status: Member | 326 Posts
Quoting knkie
Disliked
Hello i am using an indicator, T3MA. The issue is that it does not seem to 'update' in real time. If i switch to another timeframe and then back, it does. But not within the timeframe itsself. I have enclosed two screensots to show what i mean. Is there a way to add to the code so that it always refreshes so that the indicator-line is drawn to the most recent bar? Thank you in advance....
Ignored
Hi knkie,

Try this....

mind sharing how you use this indi?
Attached File
File Type: mq4 T3MA.mq4   3 KB | 351 downloads
" check out The Traders Outpost "
 
 
  • Post #2,243
  • Quote
  • May 10, 2013 8:25am May 10, 2013 8:25am
  •  aurel_79
  • | Joined Mar 2012 | Status: don't trade more then u could lose! | 183 Posts
Quoting fx-trader777
Disliked
Hi MT it would be very helpful if you do this for me. This code is based on the following logic to sell GBPUSD or EURJPY after the specific time frame and provided that the price range between this time frame is no more than certain pips, then stop and profit are placed respectfully. But something wrong is here, it doesn't work and backtesting is not accurate. Can you take a look and tell me if I am on right path? //+------------------------------------------------------------------+ //| simple EA.mq4 | //| Copyright © 2011, luktom.biz | //|...
Ignored

this is what i find when i search alittle on web about luktom...
i hope will be helpfull
Attached File
File Type: zip LVOE (1).zip   3 KB | 372 downloads
 
 
  • Post #2,244
  • Quote
  • May 10, 2013 11:16am May 10, 2013 11:16am
  •  ForMeFact0ry
  • | Joined Feb 2012 | Status: Trusted Member | 327 Posts
Script to set multiple pending orders in succession.

I am looking for a specific script.

It is simply a "Multiple Pending Order Script in Succession". I would like to open multiple pending orders from a specific price in a same direction (buy or sell).

"Multiple Pending Order Script in Succession for Buy orders":

I will need to set the script to place "buy" orders from a specific price.

The script will allow me to adjust the-
1) number of pending orders
2) number of pips between each pending order
3) T/P and S/L for all the pending order (T/P and S/L are the same for all orders)

Below is an example:
Current Price is at 1.30200
I want to place 5 "buy" pending orders in succession from 1.30300 and each pending order must be 2 pips apart. The T/P and S/L can also be specified. The script will then place all pending orders at these following prices at once:

1st Pending Order = 1.30200
2nd Pending Order = 1.30220
3rd Pending Order = 1.30240
4th Pending Order = 1.30260
5th Pending Order = 1.30280

I hope you understand what I am trying to explain.

Will look forward to constructive comments.
bit . ly/fantestimonials
 
 
  • Post #2,245
  • Quote
  • May 10, 2013 11:28am May 10, 2013 11:28am
  •  Rivabex
  • | Joined Aug 2010 | Status: Member | 37 Posts
Can the trade context to drag and drop price levels in the latest MT4 Build be disabled , and not to display trade lot size
Attached Image (click to enlarge)
Click to Enlarge

Name: MT4 Build 500.jpg
Size: 102 KB
 
 
  • Post #2,246
  • Quote
  • May 10, 2013 8:19pm May 10, 2013 8:19pm
  •  RedLineFred
  • Joined Sep 2012 | Status: Member | 326 Posts
Quoting ForMeFact0ry
Disliked
Script to set multiple pending orders in succession. I am looking for a specific script. It is simply a "Multiple Pending Order Script in Succession". I would like to open multiple pending orders from a specific price in a same direction (buy or sell). "Multiple Pending Order Script in Succession for Buy orders":......
Ignored
Hi FMFO,
I have a script similar to what you are looking for and can modify it to suit.

Please clarify:
1. Are you looking to place your first Pending Order at a specific number of pips away from current price, or at a specific price? Noting that if you are too close to this price when activating the script, MT4 may object, as there is a minimum where no pending order is accepted.

2. Do you want the SL and TP to be the same in terms of the number of pips? eg a 20 pip SL and a 40 pip TP? or do you want to specify that all oreders have a SL of 1.3040 with a TP of 1.xxxx?

3. Depending on the answer to 2) how do you want to specify the SL and TP - an exact price, a series of prices, or a fixed number of pips?

Fred
" check out The Traders Outpost "
 
 
  • Post #2,247
  • Quote
  • May 11, 2013 5:07am May 11, 2013 5:07am
  •  ForMeFact0ry
  • | Joined Feb 2012 | Status: Trusted Member | 327 Posts
Thanks redlineFred for the response in my thread.

Clarifications:

1) I want to place the pending orders from a specific price, e.g. buy orders placed at 1.30201 onwards. I do understand that there is a minimum distance required to place a pending order from the current price, it would be far enough to place the pending orders.

2) The take profit & stop loss are the same for all pending orders, e.g. each pending order have t/p 40pips & s/l 20pips.

3) i need not specify the price for t/p or s/l for each pending order as it is a fixed number of pips for all pending orders as mentioned in point number (2).

Thanks fred for looking into this.
bit . ly/fantestimonials
 
 
  • Post #2,248
  • Quote
  • May 11, 2013 9:21am May 11, 2013 9:21am
  •  vijayanscbe
  • | Joined Sep 2010 | Status: Member | 20 Posts
Anybody can code the indicator , to draw support/resistence lines with the SMA1 (open) & SMA1 (close) like , which i have shown in the chart.
Attached Image
 
 
  • Post #2,249
  • Quote
  • Edited May 12, 2013 9:21am May 11, 2013 10:48am | Edited May 12, 2013 9:21am
  •  jado911
  • Joined Mar 2009 | Status: Member | 331 Posts
Hi,
I'm trying to create some visual aid to see what my EA is doing, something like this (http://articles.mql4.com/384)
it would be ok if it was a separate indicator, I have tried to modify Real_Time_MultiIndicator but MT4 crashes on me every time I run it.

Many thanks

Jad
Attached File
File Type: mq4 kp_may 8 releas 4 hr.mq4   19 KB | 403 downloads
 
 
  • Post #2,250
  • Quote
  • May 11, 2013 7:18pm May 11, 2013 7:18pm
  •  Chace
  • | Joined Nov 2012 | Status: Member | 42 Posts
Hello Metatrader

I wondered if you could code an indicator/calculator that takes the USD, EUR, GBP, JPY, CHF, AUD, CAD, NZD pairs (the 28 permutations) and marks whether the close of the previous bar (one before the currently open one) is higher/lower than the close of the bar before it.

Allocating +1 for the higher currency and -1 for the lower one in each pair with a table showing the total for each individual currency all on one chart

E.g. if the EUR/USD's last fully closed bar closed higher than the one before, then the EUR would get +1 and the USD would get -1. Adding up all permutations should show which currency is currently strong across the board and which one is currently weak. I was thinking of doing it in percentage gained/lost but I want to test it out with simple + and -.

Let me know if you can do this otherwise I might start a thread to see if anyone else can.

Thanks mate
 
 
  • Post #2,251
  • Quote
  • May 12, 2013 9:08am May 12, 2013 9:08am
  •  RedLineFred
  • Joined Sep 2012 | Status: Member | 326 Posts
Quoting jado911
Disliked
Hi, I'm trying to create some visual aid to see what my EA is doing, something like this (http://articles.mql4.com/3840) it would be ok if it was a separate indicator, I have tried to modify Real_Time_MultiIndicator but MT4 crashes on me every time I run it. Many thanks Jad {file}
Ignored
Please check your link as it doesn't seem to work.
" check out The Traders Outpost "
 
 
  • Post #2,252
  • Quote
  • May 12, 2013 9:22am May 12, 2013 9:22am
  •  jado911
  • Joined Mar 2009 | Status: Member | 331 Posts
Quoting RedLineFred
Disliked
{quote} Please check your link as it doesn't seem to work.
Ignored

Fixed , Thanks
 
 
  • Post #2,253
  • Quote
  • May 12, 2013 9:44am May 12, 2013 9:44am
  •  RedLineFred
  • Joined Sep 2012 | Status: Member | 326 Posts
Hi Jado,
Interesting article.
What specifically do you want to be able to monitor within your EA?
Fred
" check out The Traders Outpost "
 
 
  • Post #2,254
  • Quote
  • May 12, 2013 10:39am May 12, 2013 10:39am
  •  jado911
  • Joined Mar 2009 | Status: Member | 331 Posts
Hi, Fred

I like to see when each of the trade condition gives an OK for a sell or a buy, basically trying to figure better entry points.
and it would en hurt if it was multi time frames, but mainly 4hr and 1hr.
so when for each condition It displays a sell or a buy.
I'm thinking if I use the indicator I can do better analysis on my system and can later improve my EA.

Thanks

Jado
 
 
  • Post #2,255
  • Quote
  • May 13, 2013 5:01am May 13, 2013 5:01am
  •  Fxx Trader
  • | Joined Jun 2010 | Status: Member | 187 Posts
Quoting kosmo
Disliked
{quote} Fantastic! Thank you very very much. If you can make the scripts and your EA work toghether, that's just perfect. I have been trying to combine the scripts with lvoe 1.6.1 EA, but the lines drawn by lvoe just kept blinking and the levels wouldn't change.
Ignored

Kosmo. I have also been thinking of trading on similar lines. Can you please share the final EA / Script.

Thanks.
 
 
  • Post #2,256
  • Quote
  • May 13, 2013 8:21am May 13, 2013 8:21am
  •  kis
  • Joined Dec 2011 | Status: Member | 362 Posts
Hi,

Here is the 1st one.

Quoting 786 trading
Disliked
{quote} Hi Kis, Please see the screen shot and I can have the following indicator and also please when you get time and is possible, look at my #2 and #3. 1) I would like an indicator which will display the dots if any order is placed there. If order is click then solid dot other wise hollow dot (or just circle) for pending orders. Red for short and green for long. Please see the picture. 2) A script which will set TP for all pending and market orders for magic number (for example set 25 pips as default) and if any order is missing the tp it will...
Ignored
Attached File
File Type: ex4 show_orders.ex4   3 KB | 368 downloads
 
 
  • Post #2,257
  • Quote
  • May 13, 2013 2:21pm May 13, 2013 2:21pm
  •  MatthewG
  • | Joined May 2013 | Status: Junior Member | 1 Post
Hi there!

I have been looking everywhere but cannot find what i am looking for. I will really really appreciate it if you can help me out

I was wondering if it would be possible to code an alert indicator for rsivwith the following characteristics:

 

  1. It should give an alert when touching or crossing the levels 10 and 90
  2. Work on any timeframe
  3. a pop up box should appear with the information - pair,timeframe and 10/90
  4. it should also be possible to use more than one indicator on the same pair in the same window
  5. now here is where the trick comes in - i must still be able to apply it to the high/low rsi and not to the close of the rsi

Thanks in advance

 
 
  • Post #2,258
  • Quote
  • Edited at 11:38pm May 13, 2013 7:58pm | Edited at 11:38pm
  •  ShipThePips
  • | Joined Jul 2010 | Status: Member | 6 Posts
Hey!

Wondering if someone could help me with an indicator, I don't think it should be too difficult really but i'm not sure where to start

So basically it's a trend indicator/trailing stop BUT it doesn't retrace unless price closes on the other side of it. Essentially it's just a 3 day trailing stop with some slightly different rules ao that it can't retrace, it's either heading one way or the other.

So rules are -

In an uptrend

 

  1. Count the highest CLOSING PRICE as day one
  2. Then take the LOWEST LOW of Day One and the next two days back UNLESS a day is an inside bar then go back an extra day.
  3. This does not retrace, it simply reverses to downtrend rules if price closes below this trailing stop


In a downtrend (simply reverse the rules)

 

  1. Count the lowest CLOSING PRICE as day one
  2. Then take the HIGHEST HIGH of day one and the next two days back UNLESS a day is an inside bar then go back an extra day.
  3. This does not retrace, it simply reverses to uptrend rules if price closes above this trailing stop.


Would be AWESOME if someone could code this for me, hell i'll pay you if you want. Or send you a virtual hug ;-)

 
 
  • Post #2,259
  • Quote
  • May 13, 2013 11:14pm May 13, 2013 11:14pm
  •  ForMeFact0ry
  • | Joined Feb 2012 | Status: Trusted Member | 327 Posts
just want to show out to Fred or "redlinefred" who helped me with the creation of the "multiple pending order script in succession" i have tested it with a 5digits broker, thanks again to him for the adjustments.

i have tested it a little more in depth and will share with him my results after a few red tag news.

thanks fred! i love you man!
bit . ly/fantestimonials
 
 
  • Post #2,260
  • Quote
  • May 14, 2013 12:16am May 14, 2013 12:16am
  •  786 trading
  • | Joined Oct 2007 | Status: Student | 603 Posts
Quoting kis
Disliked
Hi, Here is the 1st one. {quote} {file}
Ignored
Thanks for the code.
I tested this indicator but it does not show any spot if there is limit order. I tested with black and white both background colors.
Also it my platform is crashed if I switch the time frame with this indicator.
 
 
  • Platform Tech
  • /
  • I will code your EAs and Indicators for no charge
  • Reply to Thread
    • 1 111112Page 113114115 2619
    • 1 Page 113 2619
3 traders viewing now, 1 is a member:
Mikhail5
  • More
Top of Page
Forex Factory Blog Updated: Alerting All Members
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022