Forex



Go Back   Forex Trading > Downloads > Indicators - Metatrader 4
Forex Forum Register More recent 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
  #21 (permalink)  
Old 10-05-2009, 09:52 AM
Junior Member
 
Join Date: Sep 2009
Posts: 1
meyerexport is on a distinguished road
Ea wil not trade

Hi Codersguru,

Someone has helped me build my own EA, works fine in back test but will not trade on demo or live account, what should I look for or change in the script.?

Thanks, your help is appreciated
Kind Regards
Win
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
  #22 (permalink)  
Old 10-06-2009, 08:43 AM
Junior Member
 
Join Date: Jul 2009
Posts: 1
zendyrpip15 is on a distinguished road
Need help to write a simple EA

I presently use a indicator called riskyachtar and would like someone to create an EA for me where if its red and its value is at or below -0.030 it would trigger a sell signal (or close a previous buy if there was one)and if its green and it is at or above 0.030 it would trigger a buy signal (closing the previous sell). I am new to using EA's. I am using the mt4 platform and would also like to know how to add the EA to it and use it
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
  #23 (permalink)  
Old 10-07-2009, 04:16 PM
Junior Member
 
Join Date: Feb 2009
Posts: 13
reddy is on a distinguished road
Stop Loss Code needed to add to EA

Hi All,


I am attempting to backtest an EA, however in order to do so efficiently I need to add a stop loss sunction.

Can anyone please provide me with some code to add to my EA? I do have money management EA's, but I cannot run them simultaneously iwith my EA during backtesting.


Many Thanks,


Rich.


P.S. The EA code is at (http://codebase.mql4.com/source/13861)

Last edited by reddy; 10-07-2009 at 04:19 PM.
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
  #24 (permalink)  
Old 10-07-2009, 08:36 PM
Junior Member
 
Join Date: May 2009
Posts: 5
morse0070 is on a distinguished road
Problem with my EA

Hello,

I'm working on an EA that retrieves the closing price of the last closed bar i.e. bar[1] using the hour timeframe. My initial assumption was that once the hour changed lets say from 11:59:59 to 12:00:00 close price of the bar would be the opening price of the next bar unless a new tick came in. That assumption was obviously wrong as the new doesn't update until a new tick comes in. What a stupid idea that was.

Timing on this EA is critical and I need to tally up the close price for the last closed bar for each pair asap after the new bar opens. The problem is if I'm reading say bar[1] for gbpusd at 12:00:00 but a new tick doesn't come in until say 12:00:05, then I'm getting data from what should now be bar[2].

So I Created a function that that gets the current server time and the open time for bar[0] then use the hour (12) for each to compare. If the server time hour is 12 and the open time hour for bar[0] is 12 then I assume the bar has updated. If not, I use the bid price for bar[0] to plug in as the close price for bar[1]. Most of the time this works fine.

But every so often, the times for the comparison are not updating even though the bar on the chart has clearly updated. Here is the code that checks to see of the bar has updated.....

My EA doesn't use the 1 minute window but I coded it in for debugging so I don't have to wait an hour for a bar to close.
Also, this EA does not use the start() function. All of the code is called from the init() function so it runs continuously regardless of ticks.
Can anyone shed some light on why this would occasionally fail?


Code:
bool bHasBarUpdated(string sSymbolName)
{
   datetime tCurrentBarOpenTime, tCurrentServerTime, tPreviousBarOpenTime;
   int      iCurrentBarOpenTime, iCurrentServerTime, iPreviousBarOpenTime, iDifference;
 
   RefreshRates();
      
   tPreviousBarOpenTime=iTime(sSymbolName,iTimeFrame,iBar_Shift);
   tCurrentBarOpenTime =iTime(sSymbolName,iTimeFrame,0);
   tCurrentServerTime=TimeCurrent();
      
   switch(iTimeFrame)  //extract the hour from the time to make the comparison
   {
      case 1:     //minute TF
         iCurrentBarOpenTime = StrToInteger(StringSubstr(TimeToStr(tCurrentBarOpenTime,TIME_DATE|TIME_SECONDS),14,2));
         iCurrentServerTime  = StrToInteger(StringSubstr(TimeToStr(tCurrentServerTime,TIME_DATE|TIME_SECONDS),14,2));
         break;      
   
      case 60:    //1 hour TF
         iCurrentBarOpenTime = StrToInteger(StringSubstr(TimeToStr(tCurrentBarOpenTime,TIME_DATE|TIME_SECONDS),11,2));
         iCurrentServerTime  = StrToInteger(StringSubstr(TimeToStr(tCurrentServerTime,TIME_DATE|TIME_SECONDS),11,2));
         break;
         
      default: 
         Print("Time Frame Not Supported");
         return(TRUE); 
   }

   iDifference=iCurrentServerTime-iCurrentBarOpenTime;
      
   if(iDifference==0)
      return(true);

   return(False);
}
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
  #25 (permalink)  
Old 10-09-2009, 01:40 PM
Junior Member
 
Join Date: Apr 2009
Posts: 4
tilex83 is on a distinguished road
Talking buggy indicator

hello

i have this indicator but the sound and the indicator don't work. If you compile it has an error.
Part of the code with a problem is as follows
here is the code as well as the indicator.....I would be very grateful for your time as well as your solution.

int start()
{

double thisCCI;
double lastCCI;

int counted_bars = IndicatorCounted();
if (counted_bars < 0) return (-1);
if (counted_bars > 0) counted_bars--;
int limit = Bars - counted_bars;

for (int shift = limit; shift >= 0; shift--)
{
thisCCI = iCCI(NULL, 0, CCI, PRICE_TYPICAL, shift);
lastCCI = iCCI(NULL, 0, CCI, PRICE_TYPICAL, shift + 1);

if (thisCCI >= 0 && lastCCI < 0) bufferUp[shift + 1] = bufferDn[shift + 1];
if (thisCCI <= 0 && lastCCI > 0) bufferDn[shift + 1] = bufferUp[shift + 1];

if (thisCCI >= 0)
{
bufferUp[shift] = Low[shift] - iATR(NULL, 0, ATR, shift);
if (bufferUp[shift] < bufferUp[shift + 1])
bufferUp[shift] = bufferUp[shift + 1];
}
else
{
if (thisCCI <= 0)
{
bufferDn[shift] = High[shift] + iATR(NULL, 0, ATR, shift);
if (bufferDn[shift] > bufferDn[shift + 1])
bufferDn[shift] = bufferDn[shift + 1];
}
}
}
//---- signals
shift=limit-1;
while(shift>=0)
{
if (Signals==true)
{
if (bufferUp < bufferDn && bufferUp[shift] < bufferDn[shift + 1] && TurnedUp==false);

if (bufferUp > bufferDn && bufferUp[shift] > bufferDn[shift + 1] && TurnedUp==true);
// if (ind_buffer2a[i]<ind_buffer1a[i] && ind_buffer2a[i+1]>=ind_buffer1a[i+1]) ind_buffer3[i]=ind_buffer2a[i]-0.0001;
// if (ind_buffer2a[i]>ind_buffer1a[i] && ind_buffer2a[i+1]<=ind_buffer1a[i+1]) ind_buffer4[i]=ind_buffer2a[i]+0.0001;

// if (ind_buffer3[0]==ind_buffer2a[0]-0.0001 && TurnedUp==false)
{
Alert("Trend Magic Buy: ",Symbol()," - ",Period()," at ", Close[0]," - ", TimeToStr(CurTime(),TIME_SECONDS));
TurnedDown = false;
TurnedUp = true;
}
// if (ind_buffer4[0]==ind_buffer2a[0]+0.0001 && TurnedDown==false)
{
Alert("Trend Magic SELL: ",Symbol()," - ",Period()," at ", Close[0]," - ", TimeToStr(CurTime(),TIME_SECONDS));
TurnedUp = false;
TurnedDown = true;
}
}
shift--;
}
//---- done
return (0);
Attached Files
File Type: mq4 Trend Magic_Alerts.mq4 (3.8 KB, 38 views)
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
  #26 (permalink)  
Old 10-13-2009, 07:34 PM
Avalanche2k's Avatar
Junior Member
 
Join Date: Oct 2009
Location: Russia, Kazan.
Posts: 14
Avalanche2k is on a distinguished road
Post

Quote:
Originally Posted by reddy View Post
Hi All,


I am attempting to backtest an EA, however in order to do so efficiently I need to add a stop loss sunction.

Can anyone please provide me with some code to add to my EA? I do have money management EA's, but I cannot run them simultaneously iwith my EA during backtesting.


Many Thanks,


Rich.


P.S. The EA code is at (21hour.mq4 - MQL4 Code Base)
I suppose it should be something like in attach.
Attached Files
File Type: mq4 21hour_with_SL.mq4 (3.2 KB, 13 views)
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
  #27 (permalink)  
Old 10-16-2009, 04:38 AM
Member
 
Join Date: Feb 2007
Posts: 98
mer071898 is on a distinguished road
Can a trailing stop be added to this EA?

I have a trade management EA with a breakeven trigger and a breakeven shift feature where the stop is moved to breakeven plus a shift "X" number of pips. I need to have a trailing stop added that would take over after the breakeven shift is triggered. For example, if the breakeven level is 50 and the breakeven shift is set to 25, after I'm 50 pips up the stop is moved to +25 pips. The trailing stop should take over at +25 and needs to be adjustable. Or even if a second level could be added to the breakeven shift where if the priced moved another "X" number of pips, it would shift the stop higher, that would work also. Any help would be appreciated, thanks.
Attached Files
File Type: mq4 Stealth.mq4 (5.3 KB, 19 views)
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
  #28 (permalink)  
Old 10-16-2009, 02:32 PM
400396's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 148
400396 is on a distinguished road
High Probability ETF Trading

hi guys,

i need some help with a exit startegy that i'm checking with the sp500 , i'm attaching the spread sheet, in the end i attach the exact rule.

the check the startegy on varius of etf's and get roughfly a 75% Probability , so i think it worth the time to check this set up.

thanks.
Attached Files
File Type: rar 3 DAY HIGH LOW.rar (818.6 KB, 33 views)
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
  #29 (permalink)  
Old 10-21-2009, 02:52 PM
Member
 
Join Date: Jun 2009
Posts: 46
shankees is on a distinguished road
tend weldon

i have this indicator called tend weldon but where i got the indi some of the indi were missing .This is an rar file for this indi and see the picture below
Attached Images
File Type: gif tend weldon.gif (90.9 KB, 13 views)
Attached Files
File Type: rar Tend Weldon.rar (268.9 KB, 35 views)
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
  #30 (permalink)  
Old 10-21-2009, 02:59 PM
Member
 
Join Date: Jun 2009
Posts: 46
shankees is on a distinguished road
Quote:
Originally Posted by shankees View Post
i have this indicator called tend weldon but where i got the indi some of the indi were missing .This is an rar file for this indi and see the picture below
now the problem is here.When i download the indis and placement in their appropriate place this is what appears in my chart(below).now in that rar there is indi called tcci that is missing and the indi that displays those circles above and the indi that display multi arrow above the circle and thema that changes the colour if is the one.if anybody knows where to get this indis or hhas the rar with all the indi pliz attach here so that we can discuss fully on the trade using this set up
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


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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


All times are GMT. The time now is 09:16 PM.



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