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
  #2081 (permalink)  
Old 10-04-2009, 11:50 AM
Junior Member
 
Join Date: Jun 2009
Posts: 12
whitebloodcell is on a distinguished road
Smoothing within indicator

I am trying to modify one of the bollinger percent b indicators posted here. I want (firstly anyway) to add simply an option to smooth the data with a moving average and place the result in Buffer3. Could someone please show me where I am going wrong.

PHP Code:
if(counted_bars>=BBPeriodi=Bars-counted_bars-1;
while(
i>=0)
   {  
//(Last - Lower BB)/(Upper BB - Lower BB)      
      
BLGBuffer[i]=((Close[i] - iBands(NULL,0,BBPeriod,StdDeviation,0,AppliedPrice,MODE_LOWER,i))/
      (
iBands(NULL,0,BBPeriod,StdDeviation,0,AppliedPrice,MODE_UPPER,i)-iBands(NULL,0,BBPeriod,StdDeviation,0,AppliedPrice,MODE_LOWER,i)))*100;
      
//m_level refers to the bollinger bands centre line. i.e. 21MA
      
mlevel[i]=iMA(NULL,0,BBPeriod,0,BollingerMAMethod,AppliedPrice,0);
      
Buffer3[i] = iMAOnArray(BLGBuffer0SmoothingMAPeriod0SmoothingMAMethodi);
      
i--;
   } 
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
  #2082 (permalink)  
Old 10-04-2009, 12:47 PM
Junior Member
 
Join Date: Sep 2008
Posts: 19
loh2005 is on a distinguished road
just try

try the sign #

code
# this is not a code #



Code:
how to insert the image over here ?
Attached Images
File Type: bmp QQ工具栏截屏未命名.bmp (42.3 KB, 83 views)

Last edited by loh2005; 10-04-2009 at 12:51 PM. Reason: add something
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
  #2083 (permalink)  
Old 10-07-2009, 03:58 PM
Senior Member
 
Join Date: Dec 2006
Posts: 111
dwmcqueen is on a distinguished road
Is there a way to have the EA “read” whether account is mini or standard and whether micros can be traded?
__________________
Visit http://www.openthinkingsystems.com for EA signal distribution systems, MetaTrader and Collective2 integration and general custom development.
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
  #2084 (permalink)  
Old 10-07-2009, 05:08 PM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
Quote:
Originally Posted by dwmcqueen View Post
Is there a way to have the EA “read” whether account is mini or standard and whether micros can be traded?
Obliquely only.
if(MarketInfo(Symbol(),MODE_MINLOT)==0.01)...//it's a micro account
__________________
www.rogersignals.com - Share your strategy with all
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
  #2085 (permalink)  
Old 10-11-2009, 07:39 AM
Junior Member
 
Join Date: Jul 2009
Posts: 1
kessing is on a distinguished road
Hi all...

can someone show me how to start coding indicators and EA
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
  #2086 (permalink)  
Old 10-11-2009, 10:04 AM
Senior Member
 
Join Date: Apr 2006
Posts: 158
InTrance is on a distinguished road
Quote:
Originally Posted by kessing View Post
Hi all...

can someone show me how to start coding indicators and EA
Hi,

Look here: http://www.forex-tsd.com/3746-post20.html
__________________
Need a Professional Programmer? PM me
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
  #2087 (permalink)  
Old 10-11-2009, 10:31 AM
Administrator
 
Join Date: Sep 2005
Posts: 20,088
Blog Entries: 243
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by kessing View Post
Hi all...

can someone show me how to start coding indicators and EA
Read this thread (first post): How to start with MetaTrader and forex

and this thread: Expert Advisor Builder
__________________
My blog on TSD
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
  #2088 (permalink)  
Old 10-11-2009, 10:14 PM
Senior Member
 
Join Date: Nov 2006
Posts: 308
luxinterior is on a distinguished road
Quote:
Originally Posted by kessing View Post
Hi all...

can someone show me how to start coding indicators and EA
There's plenty of information both here and over at FF. You can also do a search on Google.

For an easy introduction to EA programming check out the link in my sig. It's a good place to start for a novice programmer.

Good luck!

Lux
__________________
Build An Expert Advisor. FREE E-course As Seen On TV
ForexArea.com
Users of Gap Trader from 'Forex-Assistant' MUST Read This
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
  #2089 (permalink)  
Old 10-13-2009, 03:35 PM
Junior Member
 
Join Date: Oct 2009
Posts: 2
johnnybegoode is on a distinguished road
How to attach a trailing stop to every new order?

I am a beginner, learning coding, and need help.
When I try to modify Coders’ guru code to make 5 orders example, It will have to finish placing 5 orders before activating the trailing stop.

Do you know any code that will allow me to attach trailing stop to each new order which will activate immediately
before the next condition is being met and a new order is opened.

Even a completely different code is fine.



Coders’ guru code

total = OrdersTotal();
if(total < 5)
{
if(isCrossed == 1)
{
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+ TakeProfit*Point,
"My EA",12345,0,Green);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES ))
Print("BUY order opened : ",OrderOpenPrice());
}
else Print("Error opening BUY order : ",GetLastError());
return(0);
}
if(isCrossed == 2)
{
ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,
Bid-TakeProfit*Point,"My EA",12345,0,Red);
if(ticket>0)
{
if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES ))
Print("SELL order opened : ",OrderOpenPrice());
}
else Print("Error opening SELL order : ",GetLastError());
return(0);
}
return(0);
}
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if(OrderType()<=OP_SELL && OrderSymbol()==Symbol())
{
if(OrderType()==OP_BUY) // long position is opened
{
// should it be closed?
if(isCrossed == 2)
{
OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet) ;
// close position
return(0); // exit
}
// check for trailing stop
if(TrailingStop>0)
{
if(Bid-OrderOpenPrice()>Point*TrailingStop)
{
if(OrderStopLoss()<Bid-Point*TrailingStop)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-
Point*TrailingStop,OrderTakeProfit(),0,Green);
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
  #2090 (permalink)  
Old 10-13-2009, 06:32 PM
Junior Member
 
Join Date: Jun 2008
Posts: 10
sparow21 is on a distinguished road
Indicator to EA

Hallo everyone,
I would like to ask for help from anybody who can make the EA out of the Waddah Attar Explosion attached.
Look forward to hearing the response.
Thank you.
-s-
Attached Files
File Type: mq4 Waddah_Attar_Explosion.mq4 (7.8 KB, 2 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
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 08:17 AM.



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