Forex



Go Back   Forex Trading > Programming > Metatrader Programming






Register in Forex TSD!
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time).
Click here to register and get more information

Reply
 
Thread Tools Display Modes
  #1161 (permalink)  
Old 08-13-2008, 11:28 PM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,215
matrixebiz is on a distinguished road
I just want to close the pendings at a specific time.
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
  #1162 (permalink)  
Old 08-14-2008, 10:34 AM
Member
 
Join Date: Aug 2008
Posts: 36
fercan is on a distinguished road
Quote:
Originally Posted by matrixebiz View Post
I just want to close the pendings at a specific time.
Thanks
How about adding the code below before takis code:

Quote:
if (TimeCurrent( ) == (time you wish to close))
not really sure but it might work..

Last edited by fercan; 08-14-2008 at 10:44 AM.
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
  #1163 (permalink)  
Old 08-16-2008, 12:21 AM
matrixebiz's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 1,215
matrixebiz is on a distinguished road
Ok, also how can I check current bar or previous bar if a trade was opened?
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
  #1164 (permalink)  
Old 08-16-2008, 01:11 PM
Member
 
Join Date: Aug 2008
Posts: 36
fercan is on a distinguished road
i have created a really simple EA. and a system which i use in atleast 3 Timeframe..May problem it doesn't stop opening and i don't want to have 3 EA and 3 chart for one pair.

i need a code that would only do one order for buy and for sell per bar per TF and still open if it is on a different bar. i can have buy and sell and the same bar.

Sometimes i have 3 signal in 3 different TF. i want to take all order but i want only one order per TF and i can still take another order in another TF if it is still open but in a different bar.

example:
1 signal in 4h
1 signal in 1h but it falls in bar for 4h
1 signal in 30 min but only one bar for 1h and 4h.
3 signal will be open.

i am ok with using magic number as means of filter.

can someone help me? thank you very much.

so far this is what i thought:
for 30 mins
if (magicnumber == 123)
{
if (iTime(OrderOpenTime()) != iTime(Symbol(),PERIOD_M30,0))
{//my order code}

}

i don't have MT4 but i know somethings is not right in the logic or code. So guys please help me.

also i think we have similar problem with matrixebiz
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
  #1165 (permalink)  
Old 08-17-2008, 05:24 PM
mystified's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 188
mystified is on a distinguished road
I have added levels to HMA:

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Black
#property indicator_color2 Red
#property indicator_width1 2
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_level1 80
#property indicator_level2 60
#property indicator_level3 40
#property indicator_level4 20
#property indicator_levelcolor DarkSlateGray


But the indicator doesnt appear on a seperate window properly.Any help much appreciated.
Attached Files
File Type: mq4 HMA_v2[1].mq4 (5.9 KB, 14 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
  #1166 (permalink)  
Old 08-18-2008, 01:39 AM
Linuxser's Avatar
User Root
 
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 4,407
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 mystified View Post
I have added levels to HMA:

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Black
#property indicator_color2 Red
#property indicator_width1 2
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_level1 80
#property indicator_level2 60
#property indicator_level3 40
#property indicator_level4 20
#property indicator_levelcolor DarkSlateGray


But the indicator doesnt appear on a seperate window properly.Any help much appreciated.
Because the indicator is forced bounded:

Remove this two lines:
#property indicator_minimum 0
#property indicator_maximum 100

Levels only works fine on bounded indicators but to do a bounded indicator the calculation must include the limits.

Example: RSI = 100-(100/(1+U/D))

We know by that formula that the indicator will move between 0-100 and because that we could include 70-30 levels without fear to they would disappear.

Another example is MACD = EMA(CLOSE, 12)-EMA(CLOSE, 26)).
We set a level on M5 and when we move to H1 most probable is the level has gone.

So, we take the same formula and we make some changes MACD = (EMA(CLOSE, 12)-EMA(CLOSE, 26))/EMA(CLOSE, 26). And now we have a percent indicator. Is not bounded but we have less probabilities to lost our levels.
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
  #1167 (permalink)  
Old 08-18-2008, 08:15 AM
mystified's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 188
mystified is on a distinguished road
Thanks Linuxer.
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
  #1168 (permalink)  
Old 08-18-2008, 12:53 PM
Member
 
Join Date: Aug 2008
Posts: 36
fercan is on a distinguished road
Quote:
i have created a really simple EA. and a system which i use in atleast 3 Timeframe..May problem it doesn't stop opening and i don't want to have 3 EA and 3 chart for one pair.

i need a code that would only do one order for buy and for sell per bar per TF and still open if it is on a different bar. i can have buy and sell and the same bar.

Sometimes i have 3 signal in 3 different TF. i want to take all order but i want only one order per TF and i can still take another order in another TF if it is still open but in a different bar.

example:
1 signal in 4h
1 signal in 1h but it falls in bar for 4h
1 signal in 30 min but only one bar for 1h and 4h.
3 signal will be open.

i am ok with using magic number as means of filter.

can someone help me? thank you very much.

so far this is what i thought:
for 30 mins
if (magicnumber == 123)
{
if (iTime(OrderOpenTime()) != iTime(Symbol(),PERIOD_M30,0))
{//my order code}

}

i don't have MT4 but i know somethings is not right in the logic or code. So guys please help me.

also i think we have similar problem with matrixebiz
Can anyone help me please?
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
  #1169 (permalink)  
Old 08-18-2008, 04:05 PM
Linuxser's Avatar
User Root
 
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 4,407
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 mystified View Post
Thanks Linuxer.
This is just the example (because now you have the Oscillator HMA ) from previous post, still it's MACD but calculated on a different way.
Attached Images
File Type: gif projection5.gif (19.2 KB, 116 views)

Last edited by Linuxser; 08-18-2008 at 04:09 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
  #1170 (permalink)  
Old 08-18-2008, 08:06 PM
Junior Member
 
Join Date: Nov 2007
Posts: 8
CEHansen is on a distinguished road
What´s wrong with this indicator?

Here´s one that is probably very simple to figure out but I´m relatively new to this and have no clue how to solve the problem.

This indicator compiles without problems but there´s nothing showing up on the charts. I´m sure some of you more experienced programmers might see quickly where I made a mistake. Any help is greatly appreciated.

The indicator should draw an arrow on the charts when certain criteria are met... I wrote the explanations into the code, that makes it easier to follow...


I attached the mq4 file... i have not been able to insert the code into this box without making it look really messy .....


I´d be thrilled if anyone can help me with it... THANKS GUYS!


CEH

P.S. perhaps you can figure out how to insert the code into the message box and then comment on it, that way more people can learn from it...
Attached Files
File Type: mq4 George.mq4 (4.7 KB, 11 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

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 03:45 AM.



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