Forex Factory
  • Login

  • Username: Password:
  • 9:47pm

  • Search
  • Home

  • Forums

  • Trades

  • Calendar

  • News

  • Market

  • Brokers

Options

Search
Search
Search

Subscribe to Thread

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Need help programming some indicators/EAs 64 replies

Do You Buy EAs or Indicators from ebay? 59 replies

Dreamliners’ MPAS EAs, Indicators, etc 297 replies

Future EAs Code Language? 6 replies

EAs and indicators relating to moutaki... 17 replies

  • Platform Tech
  • /
  • Reply to Thread
  • 1,231

I will code your EAs and Indicators for no charge

  • Last Post
  • First Unread
  •  
  • 1 6667Page 686970 128
  •  
  • Post# 1,341
  • Quote
  • Dec 30, 2012 4:51pm
  • Efficacy
    Joined Dec 2012 | 8 Posts | Status: Member
This actually isn't EA related; it's just a simple indicator I'd like to have made if anyone has the spare time. I'd simply like a indicator that can take the D1 candle from a selectable number of bars back and put out this information for each weekday separately:
Average Volume
Average Hi-Low Range
Average Open-Close Range
The average open-close range divided by the average hi-low range to give a percentage


I'm terrible with programming but I think the information alone should be easy to formulate, but the tricky part might be separating it for each weekday individually.

Any help would be greatly appreciated!
  • Post# 1,342
  • Quote
  • Dec 30, 2012 8:28pm
  • Khl4v
    Joined Dec 2012 | 3 Posts | Status: Member
Hi everyone,

I did a search but I couldn't find the EA I am looking for:

I would like to have an EA (preferably for MT4) that closes a position if the closing prices of a specified number of candles are above or below a specified price.
Of course, it should work on a specified time frame (in my case usually H1).
Additionally, I would be using a normal Stop loss but I assume that I could just use MT4's built in SL function (because if the position has already been closed the EA would not do anything, right?)

I am not able to code in MQL4/5, so any help would be appreciated. Does anybody know of an EA that could do what I am looking for or would someone be willing to code it?
  • Post# 1,343
  • Quote
  • Dec 30, 2012 8:33pm
  • cyber1 ● Online
    Joined Jan 2011 | 616 Posts | Status: Member
Quoting Efficacy
This actually isn't EA related; it's just a simple indicator I'd like to have made if anyone has the spare time. I'd simply like a indicator that can take the D1 candle from a selectable number of bars back and put out this information for each weekday separately:
Average Volume
Average Hi-Low Range
Average Open-Close Range
The average open-close range divided by the average hi-low range to give a percentage


I'm terrible with programming but I think the information alone should be easy to formulate, but the tricky part might be separating...

Efficacy-
Something like this?
What it is is the range per month over the last 12 years with an average in far right column. And I suppose with a little bit of work and some time it could be made to display the day of week stats. But would obviously not be for the last 12 years it, would be for X Bars back.
It's not an indicator but a script which if dropped onto a chart will create an HTML file that looks like this.
Attached Image (click to enlarge)
Click to Enlarge

Name: Screen Shot 2012-12-30 at 8.27.59 PM.png
Size: 89 KB
  • Post# 1,344
  • Quote
  • Dec 31, 2012 2:22am
  • Efficacy
    Joined Dec 2012 | 8 Posts | Status: Member
Quoting cyber1
Efficacy-
Something like this?
What it is is the range per month over the last 12 years with an average in far right column. And I suppose with a little bit of work and some time it could be made to display the day of week stats. But would obviously not be for the last 12 years it, would be for X Bars back.
It's not an indicator but a script which if dropped onto a chart will create an HTML file that looks like this.
Yes, basically this exactly! Like you said, instead of Jan - Dec, it'll be Sunday - Monday (or whatever order you feel haha). Instead of 12 years, it could be selected number of days/bars back. Actually, if possible it'd be even better to have it be able to do date to date; that is, instead of just bars back to present, it could be a set date to another set date so that historical info can be looked at as well as current. It printing into an html report works great because then you can choose different date ranges and compare them to each other and whatnot.

If it'd be possible to tack on the volume, open-close range [and I didn't specify this before, but non-directional. Just the absolute value of the open - close range] and the open-close range divided by that range (which I'm assuming is the high-low range since that's typically what we'd refer to as just plain 'range' as far as I've seen) as a percentage to determine overall trend power, this would be absolutely wonderful! This offers some unique info like Fridays aren't actually as bad to trade as everyone seems to think and things like that.



As a side note, I also use IBFX here in the US and was wondering how your experience has been with them so far? Mine has been less than a month so far, but it's been great so I'm just curious if they're good still in the long run.
  • Post# 1,345
  • Quote
  • Dec 31, 2012 8:11am
  • cyber1 ● Online
    Joined Jan 2011 | 616 Posts | Status: Member
Quoting Efficacy
Yes, basically this exactly! Like you said, instead of Jan - Dec, it'll be Sunday - Monday (or whatever order you feel haha). Instead of 12 years, it could be selected number of days/bars back. Actually, if possible it'd be even better to have it be able to do date to date; that is, instead of just bars back to present, it could be a set date to another set date so that historical info can be looked at as well as current. It printing into an html report works great because then you can choose different date ranges and compare them to each other...
Efficacy-
Although I have no idea when I would get this done. Hopefully someone else will come up with a solution as well.
Check out this thread:
http://www.forexfactory.com/showthread.php?p=6315571
It's along the same lines but again would have to be modified to display the data that you're looking for.

I've been with IBFX for over three years and have no complaints.
  • Post# 1,346
  • Quote
  • Dec 31, 2012 8:22am
  • laoshr
    Joined Jun 2009 | 54 Posts | Status: Member
Quoting cyber1
laoshr-

If you increment your loop instead of decrement this will do as you requested. Essentially it repaints.

for(int ii=0; ii<Bars; ii++){
Thank You Cyber1! I got it working well. A few more things to do but it all looks good. Thanks again for all your help and direction.

Happy New Year!

LaoShr
  • Post# 1,347
  • Quote
  • Jan 1, 2013 8:02pm
  • laoshr
    Joined Jun 2009 | 54 Posts | Status: Member
Quoting cyber1
laoshr-

If you increment your loop instead of decrement this will do as you requested. Essentially it repaints.

for(int ii=0; ii<Bars; ii++){
Happy New Year! I hope you had a safe and fun New Years Eve. Thank you for all your help on the indicator. It is working VERY well.

I had a question about taking the ATR and a moving average and using them as a filter for ranging markets. I can plot the ATR on a chart and then add the MA in the same window and use the previous indicators data. Then when the MA crosses down there is a ranging market and when the MA crosses back up the market is ending the range.

What I want to do is use that in my custom indicator I've been working on. Would I need to first create a custom indicator with the ATR and MA and then add it to my filters on the custom indicator? Or, is there a way to just program those to play off each other? I guess I'm asking if there is a SIMPLE way to do it. LOL.

Thanks again.

LaoShr
  • Post# 1,348
  • Quote
  • Jan 2, 2013 9:16am
  • knkie
    Joined Apr 2012 | 60 Posts | Status: Member
Hello. still learning...
im trying to set horizontal lines on the 1 hourly chart for the highest close and lowest close with in a number of bars, for example 5 bars.

im using the folowing for this:

double hc5 = Close[iHighest(Symbol(),PERIOD_H1,MODE_CL OSE,5,1)];
double lc5 = Close[iLowest(Symbol(),PERIOD_H1,MODE_CLO SE,5,1)];

I simply want to draw two lines at these levels (hc5 and lc5).
And im not being succesful at all.

Could someone help me with this?
much appreciated !
  • Post# 1,349
  • Quote
  • Jan 2, 2013 10:48am
  • RaptorUK
    Joined Jan 2008 | 601 Posts | Status: Member
Quoting knkie
Hello. still learning...
im trying to set horizontal lines on the 1 hourly chart for the highest close and lowest close with in a number of bars, for example 5 bars.

im using the folowing for this:

double hc5 = Close[iHighest(Symbol(),PERIOD_H1,MODE_CL OSE,5,1)];
double lc5 = Close[iLowest(Symbol(),PERIOD_H1,MODE_CLO SE,5,1)];

I simply want to draw two lines at these levels (hc5 and lc5).
And im not being succesful at all.

Could someone help me with this?
much appreciated !
Your code looks OK to me, you need to use these values when you ObjectCreate() or ObjectSet() the lines . . . show the rest of your code please.
20 pips a day isn't too much to ask . . .
  • Post# 1,350
  • Quote
  • Jan 2, 2013 11:07am
  • knkie
    Joined Apr 2012 | 60 Posts | Status: Member
Quoting RaptorUK
Your code looks OK to me, you need to use these values when you ObjectCreate() or ObjectSet() the lines . . . show the rest of your code please.
hello Raptor
Thank you for your time

this is what im doing in the code;
keeping it simple so i can learn coding. thats the aim here....



#property indicator_chart_window
int init()
{
double hc5 = Close[iHighest(Symbol(),PERIOD_H1,MODE_CL OSE,5,1)];
}
int start()
{
ObjectCreate(hc5, OBJ_HLINE, 0, Time[1], hc5);
ObjectSet(hc5, OBJPROP_STYLE, STYLE_SOLID);
}
int deinit()
{
ObjectsDeleteAll();
return(0);
}
  • Post# 1,351
  • Quote
  • Jan 2, 2013 11:28am
  • RaptorUK
    Joined Jan 2008 | 601 Posts | Status: Member
Quoting knkie
hello Raptor
Thank you for your time

this is what im doing in the code;
keeping it simple so i can learn coding. thats the aim here....
OK, some general comments first:

don't use ObjectsDeleteAll(), it's lazy, if anyone else tries your indicator on their chart it will not only remove your Object but any of their Objects too, by all means delete your Objects in deinit(), but just delete your own

don't be afraid to use blank spaces and lines to separate functions and other bits of code or variables, they all get taken out when the code is compiled so your ex4 will be no bigger but your code will be easier to read

specific comment:

you are setting the variable hc5 in init() and have declared it locaally to init(), as a result the start() function cannot "see" this variable . . . make it globally declared variable instead . . .

do you have a blank space here "MODE_CL OSE" ?

Try this . . .

Inserted Code
#property indicator_chart_window

double hc5;   //  globally declared

int init()
   {
   hc5 = Close[iHighest(Symbol(),PERIOD_H1,MODE_CLOSE,5,1)];
   }

int start()
   {
   ObjectCreate(hc5, OBJ_HLINE, 0, Time[1], hc5);
   ObjectSet(hc5, OBJPROP_STYLE, STYLE_SOLID);
   }

int deinit()
   {
   ObjectsDeleteAll();
   return(0);
   }
20 pips a day isn't too much to ask . . .
  • Post# 1,352
  • Quote
  • Jan 2, 2013 11:31am
  • knkie
    Joined Apr 2012 | 60 Posts | Status: Member
Quoting RaptorUK
OK, some general comments first:

don't use ObjectsDeleteAll(), it's lazy, if anyone else tries your indicator on their chart it will not only remove your Object but any of their Objects too, by all means delete your Objects in deinit(), but just delete your own

don't be afraid to use blank spaces and lines to separate functions and other bits of code or variables, they all get taken out when the code is compiled so your ex4 will be no bigger but your code will be easier to read

specific comment:

you are setting the variable hc5...



Wow thank you for your fast reply
i will take all your advice to heart;
especially concerning ObjectsDeleteAll();

Im gonna try out the code now.....

==================================

UPDATE:
ok, i tried it with your code Raptor but its not drawing a line
this is frustrating lol.

Does it draw for you ?
Or do you see anything we are still forgetting?
  • Post# 1,353
  • Quote
  • Jan 2, 2013 11:58am
  • RaptorUK
    Joined Jan 2008 | 601 Posts | Status: Member
Quoting knkie
UPDATE:
ok, i tried it with your code Raptor but its not drawing a line
this is frustrating lol.

Does it draw for you ?
Or do you see anything we are still forgetting?
I didn't actually try it . . . I have now, I should have mentioned that the Object name must be a string . . .

Inserted Code
ObjectCreate("hc5", OBJ_HLINE, 0, Time[1], hc5);
ObjectSet("hc5", OBJPROP_STYLE, STYLE_SOLID);
20 pips a day isn't too much to ask . . .
  • Post# 1,354
  • Quote
  • Jan 2, 2013 12:01pm
  • RaptorUK
    Joined Jan 2008 | 601 Posts | Status: Member
This works . . .

Inserted Code
#property indicator_chart_window

double hc5;   //  globally declared

int init()
   {
   hc5 = Close[iHighest(Symbol(),PERIOD_H1,MODE_CLOSE,5,1)];
   }

int start()
   {
   ObjectCreate("hc5", OBJ_HLINE, 0, Time[1], hc5);
   ObjectSet("hc5", OBJPROP_STYLE, STYLE_SOLID);
   }

int deinit()
   {
   ObjectDelete("hc5");
   return(0);
   }
20 pips a day isn't too much to ask . . .
  • Post# 1,355
  • Quote
  • Jan 2, 2013 12:06pm
  • RaptorUK
    Joined Jan 2008 | 601 Posts | Status: Member
Quoting RaptorUK
This works . . .
But it's a bit naughty because for each tick it creates an Object that already exists, so you should actually do this . . .

Inserted Code
#property indicator_chart_window

double hc5;   //  globally declared

int init()
   {
   hc5 = Close[iHighest(Symbol(),PERIOD_H1,MODE_CLOSE,5,1)];
   }

int start()
   {
   if(ObjectFind("hc5") == -1)    // if Object hc5 doesn't already exist 
      ObjectCreate("hc5", OBJ_HLINE, 0, Time[1], hc5);    // create it

   ObjectSet("hc5", OBJPROP_TIME1, Time[1]);
   ObjectSet("hc5", OBJPROP_PRICE1, hc5);
   ObjectSet("hc5", OBJPROP_STYLE, STYLE_SOLID);
   }

int deinit()
   {
   ObjectDelete("hc5");
   return(0);
   }
20 pips a day isn't too much to ask . . .
  • Post# 1,356
  • Quote
  • Jan 2, 2013 12:14pm
  • RaptorUK
    Joined Jan 2008 | 601 Posts | Status: Member
Quoting RaptorUK
But it's a bit naughty because for each tick it creates an Object that already exists, so you should actually do this . . .

But this is a little pointless, all it does is draw the line and then update it for each tick . . . and the update is the same value because the value has been set during init() . . . this updates the line for each new bar.

Inserted Code
#property indicator_chart_window

double hc5;          //  globally declared
datetime Bar1Time;   //  time of Bar 1

int init()
   {
   return(0);
   }

int start()
   {
   if(Time[1] != Bar1Time)  //  we have a new bar   
      {
      hc5 = Close[iHighest(Symbol(), PERIOD_H1, MODE_CLOSE, 5, 1)];  // get new value for hc5
      
      if(ObjectFind("hc5") == -1)    // if Object hc5 doesn't already exist 
         ObjectCreate("hc5", OBJ_HLINE, 0, Time[1], hc5);    // create it

      ObjectSet("hc5", OBJPROP_TIME1, Time[1]);
      ObjectSet("hc5", OBJPROP_PRICE1, hc5);
      ObjectSet("hc5", OBJPROP_STYLE, STYLE_SOLID);
      
      
      Bar1Time = Time[1];
      }
      
   return(0);
   }

int deinit()
   {
   ObjectDelete("hc5");
   return(0);
   }
20 pips a day isn't too much to ask . . .
  • Post# 1,357
  • Quote
  • Jan 2, 2013 4:08pm
  • FxIsland
    Joined Aug 2012 | 6 Posts | Status: Member
Hi,
Is there anyone who could help me with that EA. It's MA Cross EA and I need to add a code to close half a position when in profit
It should look like that
When in profits .... ( in pips)
than close half or any lot size without moving SL
and leave the half to run or hit TP

I need to secure some profits without moving SL it's good in ranging market

Thank you
Attached File
File Type: mq4 Kolier_MA_Crossover_EA.mq4   25 KB | 32 downloads
  • Post# 1,358
  • Quote
  • Jan 3, 2013 2:58am
  • jerseyrichie
    Joined Feb 2012 | 11 Posts | Status: Member
hey all, i am looking for a simple indicator--simiular to andrews pitchfork---but pre set with 3 lines 0 being the top line---45 pips being the center line----and 90 pips being the lower line--andrews is a pain to set horozontal and keep trying to adjust to theese levels --and can be moved around the chart fixed at theese levels --or adjustable to theese levels---should say its basically a triple horozontal set of three lines that can be placed on the chart and moved around the chart --pre set as one--thanks--Richie
  • Post# 1,359
  • Quote
  • Jan 3, 2013 3:34am | Edited at 4:30am
  • knkie
    Joined Apr 2012 | 60 Posts | Status: Member
Quoting RaptorUK
But this is a little pointless, all it does is draw the line and then update it for each tick . . . and the update is the same value because the value has been set during init() . . . this updates the line for each new bar.

[code]#property indicator_chart_window

double hc5; // globally declared
datetime Bar1Time; // time of Bar 1

int init()
{
return(0);
}

int start()
{
if(Time[1] != Bar1Time) // we have a new bar
{
hc5 = Close[iHighest(Symbol(), PERIOD_H1, MODE_CLOSE, 5, 1)]; //...



good morning,
you sir, are AWESOME

thank you for showing the different setups, that teaches me alot


I have a question concerning the code if i may?
you delcare a variable:
datetime Bar1Time;
but it is not defined. So when the function Time[1] = Bar1Time is used, how does the code know what the value of Bar1Time is?
  • Post# 1,360
  • Quote
  • Jan 3, 2013 5:33am
  • jerseyrichie
    Joined Feb 2012 | 11 Posts | Status: Member
Quoting jerseyrichie
hey all, i am looking for a simple indicator--simiular to andrews pitchfork---but pre set with 3 lines 0 being the top line---45 pips being the center line----and 90 pips being the lower line--andrews is a pain to set horozontal and keep trying to adjust to theese levels --and can be moved around the chart fixed at theese levels --or adjustable to theese levels---should say its basically a triple horozontal set of three lines that can be placed on the chart and moved around the chart --pre set as one--thanks--Richie
actually i need it fixed so it doesnt update with each tick,justa as a trendline or horozontial line
this type of stop run happens many times a day--can usually pull at least 40-50 pips--i use andrews pitchfork as a visual but is a pain to adjust all of the time--thanx
Attached Image (click to enlarge)
Click to Enlarge

Name: andrews.gif
Size: 30 KB
Thread Tools Search this Thread
Show Printable Version Show Printable Version
Email This Thread Email This Thread
Search this Thread:

Advanced Search

  • Platform Tech
  • /
  • I will code your EAs and Indicators for no charge
  • Reply to Thread
    • 1 6667Page 686970 128
0 traders viewing now
  • More

©2013 Forex Factory, Inc. / Terms of Use / Privacy Policy

Forex Factory® is a registered trademark.

Connect

  • Facebook
  • Twitter
  • RSS

Company

  • About FF
  • FF Blog
  • Careers at FF
  • Advertising
  • Contact FF

Products

  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer

Website

  • Homepage
  • Search
  • User Guide
  • Member List
  • Online Now
  • Report a Bug