Forex



Go Back   Forex Trading > Programming > MetaTrader
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
  #1771 (permalink)  
Old 05-11-2009, 09:29 PM
Junior Member
 
Join Date: Feb 2009
Posts: 9
todonnelliv is on a distinguished road
Talking Simple EA Request

Hello, I have a few indicators that I use for trade entries and I was curious if someone could help me out with a few simple ea's because I haven't been able to find them around the internet. The first one is called DSS Bressert, it's a form of Double Smoothed Stochastic and can be found here: http://www.forexfactory.com/attachme...d=222585&d=Mar 23, 2009 2:22pm What I'm looking for in this ea is to open a position when a particular level is crossed. for example, a sell will open when the price exceeds level 80 and then crosses down past 80. and a buy will occur when the price crosses 20 and then turns to raise above 20. The only thing is if possible I would like the levels to be adjustable in the settings. Another feature I would like if possible would be a "long only" or "short only" setting so the ea will trade in only one direction or both if i so choose. A final setting would be a "close all at price" setting so for example if i'm doing all sell orders and the price is 98.100 I can set it so all positions close at 97.000. I would like this EA to be able to open more than one positions at a time and possibly with a magic number. I have many other features in mind but those are the basics and I don't want to get too greedy.

The other indi I use and would like an ea for is Barry's support and resistance. which can be found here: http://www.forexfactory.com/attachme...d=221898&d=Mar 21, 2009 9:13pm what I'm looking for in this EA is to have the ability to open a trade sell at resistance, and buy at support, but most importantly I would like it to have an "alert only" setting in which it can be used simply to alert when a new support/resistance has been identified.

Honestly I have Ideas to make an extremely profitable trading system and would like a programmer to work with who has some free time. I was working with a guy for a week or so but he disappeared. So if anyone has any free time please let me know and we can work together to make some real cash.
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
  #1772 (permalink)  
Old 05-12-2009, 03:21 AM
Member
 
Join Date: Dec 2008
Posts: 49
jan100 is on a distinguished road
Is it possible to give out an error message if DLL calls are not allowed?

Thanks in advance.
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
  #1773 (permalink)  
Old 05-12-2009, 03:40 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 820
wolfe is on a distinguished road
Quote:
Originally Posted by jan100 View Post
Is it possible to give out an error message if DLL calls are not allowed?

Thanks in advance.
Use this in the init() section of your code:

PHP Code:
if (IsDllsAllowed() == false)
   {
    
Alert("Dll is NOT ALLOWED!!!");
   } 
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
  #1774 (permalink)  
Old 05-12-2009, 04:24 AM
Member
 
Join Date: Dec 2008
Posts: 49
jan100 is on a distinguished road
thank you :-)
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
  #1775 (permalink)  
Old 05-12-2009, 02:06 PM
Junior Member
 
Join Date: Dec 2008
Posts: 8
xBweNx is on a distinguished road
Need help fixing script

this trailing script doesn't want to work correctly with me. I closes order right when i open it or doesnt place and close the trade correctly. Can someone take a look at it? that or is there another script(not ea) that you can use a trendline as the stoploss line so its hidden from your broker?


Code:
//+------------------------------------------------------------------+
//|                                                 TrailingLine.mq4 |
//|                                                            Roger |
//+------------------------------------------------------------------+
#property show_inputs

extern bool TrailingLine=false;
int _OrderTicket;

int start()
{
//+------------------------------------------------------------------+
int Order_Find_Radius = 0;

int Stop_Loss = 30;
int Take_Profit = 0;

int Slippage = 50;

//+------------------------------------------------------------------+
double Open_Price_Level, Stop_Loss_Level, PriceClose, Take_Profit_Level, Take_Profit_Level_new, Stop_Loss_Level_new;
int _break;
double lev;
double DropPrice = WindowPriceOnDropped();
bool mod;
for ( int x = 0; x <= Order_Find_Radius; x ++ )
{
	for ( int z = 0; z < OrdersTotal(); z ++ )
	{
		OrderSelect( z, SELECT_BY_POS, MODE_TRADES );
		if ( OrderSymbol() == Symbol() )
		{
			if ( MathAbs(( DropPrice - OrderOpenPrice() )/Point) <= x )
			{ _break = 1;
			    break;
		   }
		}
	}
	if ( _break == 1 ) break; 
}

string ord;
int _OrderType = OrderType();
if(_OrderType==0)ord="BUY"; else ord="SELL";
_OrderTicket = OrderTicket();
Open_Price_Level = Bid;
if ( Stop_Loss > 0 )
   {
   if(_OrderType==0)Stop_Loss_Level = Open_Price_Level - Stop_Loss*Point; 
   if(_OrderType==1)Stop_Loss_Level = Open_Price_Level + Stop_Loss*Point;
   ObjectCreate( "Stop_Loss_Line"+_OrderTicket, OBJ_HLINE, 0, 0, Stop_Loss_Level, 0, 0, 0, 0 );
   ObjectSet( "Stop_Loss_Line"+_OrderTicket, OBJPROP_COLOR,Purple );
   ObjectSetText( "Stop_Loss_Line"+_OrderTicket, "Stop_Loss_Line", 6, "Arial", Purple );
   }
else Stop_Loss_Level =0;
if ( Take_Profit >0 )
   {
   if(_OrderType==0)Take_Profit_Level=Open_Price_Level + Take_Profit*Point; 
   if(_OrderType==1)Take_Profit_Level=Open_Price_Level - Take_Profit*Point; 
   ObjectCreate( "Take_Profit_Line"+_OrderTicket, OBJ_HLINE, 0, 0, Take_Profit_Level, 0, 0, 0, 0 );
   ObjectSet( "Take_Profit_Line"+_OrderTicket, OBJPROP_COLOR,Lime );
   ObjectSetText( "Take_Profit_Line"+_OrderTicket, "Take_Profit_Line", 6, "Arial", Lime );
   }   
else Take_Profit_Level=0;
lev=Open_Price_Level-Stop_Loss_Level;
Print("OrderType - ",ord," OrderTicket - ",_OrderTicket," OpenPrice - ",Open_Price_Level," StopLoss - ",Stop_Loss_Level," TakeProfit - ",Take_Profit_Level);
WindowRedraw();

int xx;
while( xx<1)
   {
   RefreshRates();
	if(ObjectFind("Stop_Loss_Line"+_OrderTicket)!=-1)Stop_Loss_Level_new = NormalizeDouble( ObjectGet( "Stop_Loss_Line"+_OrderTicket, OBJPROP_PRICE1 ), MarketInfo( Symbol(), MODE_DIGITS ) ); 
	else 
	  {
	  Stop_Loss_Level=0;
	  Stop_Loss_Level_new =0;
	  }
	if(ObjectFind("Take_Profit_Line"+_OrderTicket)!=-1)Take_Profit_Level = NormalizeDouble( ObjectGet( "Take_Profit_Line"+_OrderTicket, OBJPROP_PRICE1 ), MarketInfo( Symbol(), MODE_DIGITS ) );
	else Take_Profit_Level=0;
   if(Stop_Loss_Level==0&&Take_Profit_Level==0)break;
   if(_OrderType==0)PriceClose=Bid; else PriceClose=Ask;
   if(Stop_Loss_Level!=Stop_Loss_Level_new)lev=Bid-Stop_Loss_Level_new;
   Stop_Loss_Level=Stop_Loss_Level_new;
   if(TrailingLine)
            if(MathAbs(Bid-Stop_Loss_Level)>MathAbs(lev)&&Stop_Loss_Level!=0)
                  {
                  Stop_Loss_Level=Bid-lev;
                  ObjectMove( "Stop_Loss_Line"+_OrderTicket, 0, 10,Stop_Loss_Level );
                 WindowRedraw();            
                  }
              
      Comment("Order ",ord," - ",_OrderTicket, " StopLoss - ",Stop_Loss_Level," TakeProfit - ",Take_Profit_Level);
      if((lev<0&&iHigh(0,1,0)>=Stop_Loss_Level&&Stop_Loss_Level>0)||(lev>0&&iLow(0,1,0)<=Stop_Loss_Level)||
      (iHigh(0,1,1)<Take_Profit_Level&&iHigh(0,1,0)>=Take_Profit_Level)||(iLow(0,1,1)>Take_Profit_Level&&iLow(0,1,0)<=Take_Profit_Level))//условия пересечения стопа или профита
            {
            for(int i=0;i<OrdersTotal();i++)
                  {
                  OrderSelect( i, SELECT_BY_POS, MODE_TRADES );
	               if (_OrderTicket == OrderTicket())
                        {
                        if(OrderClose(OrderTicket(),OrderLots(),PriceClose,Slippage,CLR_NONE))
                              {
                              break;
                              }
                        }
                  }
            }
   OrderSelect(_OrderTicket,SELECT_BY_TICKET,MODE_TRADES);
   if(OrderCloseTime( ) !=0)break;
   Sleep(2000);
   }
return(-1);
}

int deinit()
{
ObjectDelete( "Stop_Loss_Line"+_OrderTicket );
ObjectDelete( "Take_Profit_Line"+_OrderTicket );
Comment("");
return(0);
}
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
  #1776 (permalink)  
Old 05-12-2009, 05:05 PM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
Quote:
Originally Posted by xBweNx View Post
this trailing script doesn't want to work correctly with me. I closes order right when i open it or doesnt place and close the trade correctly. Can someone take a look at it? that or is there another script(not ea) that you can use a trendline as the stoploss line so its hidden from your broker?

Try this
http://www.forex-tsd.com/242080-post497.html
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
  #1777 (permalink)  
Old 05-12-2009, 11:32 PM
Junior Member
 
Join Date: Dec 2008
Posts: 8
xBweNx is on a distinguished road
thanks roger! ill give this one a try hopefully it will work the way i want it to
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
  #1778 (permalink)  
Old 05-13-2009, 01:47 AM
Junior Member
 
Join Date: Dec 2008
Posts: 8
xBweNx is on a distinguished road
Quote:
Originally Posted by Roger09 View Post
i dont know why but it seem like this scrip closes my traded also. atleast just the first one i put in for the pair than if i apply the script again it works fine?
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
  #1779 (permalink)  
Old 05-13-2009, 06:04 AM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
Quote:
Originally Posted by xBweNx View Post
i dont know why but it seem like this scrip closes my traded also. atleast just the first one i put in for the pair than if i apply the script again it works fine?
Who is your broker? I will try. I've never had this problem.
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
  #1780 (permalink)  
Old 05-13-2009, 04:40 PM
Junior Member
 
Join Date: Dec 2008
Posts: 8
xBweNx is on a distinguished road
my broker is alpari
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: 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

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 09:15 PM.



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