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
  #2131 (permalink)  
Old 10-29-2009, 11:28 PM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
Quote:
Originally Posted by Tio Patinhas View Post
Hi guys !


Please, what i need put in my EA to it open the orders only when the time hour equals 00:00 ? I need that it open the order only in this hour, can you put here to me the programation code ?

I trying this but it not works:


if (TimeHour(TimeCurrent() == 0)
{
OrderSend(Symbol(), OP_BUY, Lot, Ask, Slippage, SL, TP, 0, Magic, 0, Lime);
}


Thank you very much !
Try this way:
Code:
int mark;
int start()
{
....
if(Hour()==0&&mark==0)
{ 
OrderSend(Symbol(), OP_BUY, Lot, Ask, Slippage, SL, TP, 0, Magic, 0, Lime);
mark=1;
}

if(Hour()>1)mark=0;
...
}
__________________
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
  #2132 (permalink)  
Old 10-30-2009, 12:51 AM
Junior Member
 
Join Date: Sep 2009
Posts: 5
Tio Patinhas is on a distinguished road
Quote:
Originally Posted by Roger09 View Post
Try this way:
Code:
int mark;
int start()
{
....
if(Hour()==0&&mark==0)
{ 
OrderSend(Symbol(), OP_BUY, Lot, Ask, Slippage, SL, TP, 0, Magic, 0, Lime);
mark=1;
}

if(Hour()>1)mark=0;
...
}



IT WORKS !!! tHANK YOU VERY MUCH MY FRIEND, YOU IS THE MAN!!!
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
  #2133 (permalink)  
Old 10-30-2009, 04:22 AM
Member
 
Join Date: Oct 2006
Posts: 73
junglelion is on a distinguished road
How to

How to add lines in indicator like RSI 80% RSI 20% in mql4 code , not through manual method

Guide the code used.
__________________
This Lion Seeks A Lioness
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
  #2134 (permalink)  
Old 10-30-2009, 04:52 AM
Linuxser's Avatar
User Root
 
Join Date: May 2006
Location: Helliconia (Spring)
Posts: 4,413
Blog Entries: 56
Linuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond reputeLinuxser has a reputation beyond repute
Quote:
Originally Posted by junglelion View Post
How to add lines in indicator like RSI 80% RSI 20% in mql4 code , not through manual method

Guide the code used.
By buffer or by instruction

By instruction is something like

#property indicator_level1 30
#property indicator_level2 70
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
  #2135 (permalink)  
Old 10-30-2009, 06:17 AM
Member
 
Join Date: Oct 2006
Posts: 73
junglelion is on a distinguished road
Quote:
Originally Posted by Linuxser View Post
By buffer or by instruction

By instruction is something like

#property indicator_level1 30
#property indicator_level2 70
lets say i wish to draw 80% level on the momemtum indicator takingthe array max and array min values

how to draw that line

i do get the 80% value, but how to put it on chart
__________________
This Lion Seeks A Lioness
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
  #2136 (permalink)  
Old 10-30-2009, 05:38 PM
Junior Member
 
Join Date: Sep 2009
Posts: 5
Tio Patinhas is on a distinguished road
Hi guys !!


My EA are opening orders in the hour 0:00 to 01:00. Its exactly what i want, but, i need that it open only one order in this time. When it take the profit it opens a new order, i not want this. I want thath it opens only one order in the period of the 00:00 to 01:00. In other words, only one trade per day.

how i can code it ?

This is the code thath i´m using:



if(Hour()<=0 && Mark==0)


if (Mark == 0)
{
if(Buy_Orders && Total < 1 )
{
OrderSend(Symbol(), OP_BUY, Lot, Ask, Slippage, StopLossBuy, TakeProfitBuy, Coment, Magic, Lime);
Mark=1;
}
if(Sell_Orders && Total < 1)
{
OrderSend(Symbol(), OP_SELL, Lot, Bid, Slippage, StopLossSell , TakeProfitSell, Coment, Magic, Red);
Mark=1;
}
}

if(Hour()>1) Mark=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
  #2137 (permalink)  
Old 10-30-2009, 10:09 PM
Senior Member
 
Join Date: Oct 2008
Location: Vancouver, BC
Posts: 159
Roger09 is on a distinguished road
Quote:
Originally Posted by Tio Patinhas View Post
Hi guys !!
It should work. Show us the whole code.
__________________
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
  #2138 (permalink)  
Old 10-31-2009, 04:51 AM
Junior Member
 
Join Date: Sep 2009
Posts: 5
Tio Patinhas is on a distinguished road
Quote:
Originally Posted by Roger09 View Post
It should work. Show us the whole code.
Problem resolved... Thanks !
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
  #2139 (permalink)  
Old 10-31-2009, 06:23 PM
Junior Member
 
Join Date: Oct 2008
Posts: 9
N8937G is on a distinguished road
GlobalVariable help....

I'd like to create 2 GlobalVariable so that when my EA restarts it knows to use these two variables if they exist

The first is the value of a currency when an order (the first order) was placed, I call this variable center. It is the center value ie. Bid + Ask / 2 = center

The second is count ...Just a simple count that I increase by one with every new order.....until I close them all and the count is reset to zero.

//================================================== =====

Will this work to check for Global Variables "center" and "count"....and if found write the values to the variables center and count in my EA?



if (GlobalVariableCheck(center))
if (GlobalVariableCheck(count))
{
center = (GlobalVariableGet(center));
count = (GlobalVariableGet(count));
AskStart=1;
BidStart=1;
}

//================================================== ============

Will this (assuming AskStart and BidStart are zero) write the center value to the GlobalVariable "center"


if(AskStart==0)
if(BidStart==0)
{
AskStart = NormalizeDouble((Ask),4);
BidStart=NormalizeDouble((Bid),4);
center=((AskStart+BidStart)/2);
NormalizeDouble((center),4);
Print(center);
AskStart=1;
BidStart=1;
Comment(center);
GlobalVariableSet("center",center);

}


//================================================== ===================

Will this write the value of count to GlobalVariable "count"?


tic = -1;
if(TradeLong)
if(center>(Ask+sh1))


if (count==1)
{
while((tic == -1 )&&center>(Ask+sh1))
{
Sleep(4000);
RefreshRates();
tic = OrderSend(Symbol(),OP_BUY,LE1, NormalizeDouble((Ask),4),5,Ask-sl1*Point,0,"",255,0,CLR_NONE);
}

if (tic != -1)
{
count=2;
GlobalVariableSet("count", count);
tic = -1;
}
else
{
return(0);
}


while((tic == -1 )&&center>(Ask+sh1))
{
Sleep(4000);
RefreshRates();
tic = OrderSend(Symbol(),OP_SELL,LE00, NormalizeDouble((Bid),4),5,Bid+sl0*Point,Bid-tp000*Point,"",255,0,CLR_NONE);

}

return(0);

}


//==============================================

Will this Delete GlobalVariable count and center??



if(OrdersTotal()==0)
{

Closenow=False;

count=1;
AskStart=0;
BidStart=0;
center=0;
Hedgeonce=1;
GlobalVariableDel(center);
GlobalVariableDel(count);
}



Thank you for your help and review.....
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
  #2140 (permalink)  
Old 11-01-2009, 01:59 AM
Junior Member
 
Join Date: May 2006
Posts: 2
jsenne is on a distinguished road
simple ea

is there an EA that opens trades at a set time of day, and lets you set prices....exit strategy.....all variables
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 10:54 AM.



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