Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs 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
  #1461 (permalink)  
Old 04-07-2009, 06:38 AM
Junior Member
 
Join Date: Sep 2008
Location: US
Posts: 10
AceFX is on a distinguished road
Thank you!

Ben,

Can't thank you enough for the quick and helpful reply. You were absolutely correct and I am a step closer because of it!

I do have one more question however, trying to add a break even point at a level less than the trailing stop but haven't gotten past:

extern bool UseBreak_Even = True;
extern int Break_Even = 20;

...

Any chance on some advice here as well?

Thanks again and take care!
-Ace
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
  #1462 (permalink)  
Old 04-08-2009, 02:05 AM
Junior Member
 
Join Date: Apr 2009
Posts: 1
Colinlf is on a distinguished road
Time Frames

Is there a MA that is capable of storing ticker data that can then be used in MT4 or Excel.


Example: 1 Second, 2 Second, 3 Second, 4 Second, 5 Second, 10 Second, 20 Second Etc Etc


Storing Ticker values, each 1/10th of a second then X this value by your desired time frame
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
  #1463 (permalink)  
Old 04-20-2009, 10:30 PM
Senior Member
 
Join Date: Dec 2008
Posts: 132
finimej is on a distinguished road
Question,
Can I use #include in an indicator? if not? Why not?
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
  #1464 (permalink)  
Old 04-20-2009, 10:31 PM
Junior Member
 
Join Date: Feb 2006
Posts: 4
wyobenjamin is on a distinguished road
Yes, you can use #include in an indicator.
-B
__________________
FX Robot Man - Live Demo Statements
http://www.fxrobotman.com
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
  #1465 (permalink)  
Old 04-24-2009, 02:57 PM
nck's Avatar
nck nck is offline
Member
 
Join Date: Nov 2008
Posts: 47
nck is on a distinguished road
ea modification

hi everybody, i have my own ea and would like to get the exit stategy modified,the ea right now exits at tp or sl ,i'd like to have the ea exit at the next signal and place a new entry at the same arrow,

btw i'd appreciate for any help ,i paid for that ea ,i give the file here and you can play with it
Attached Files
File Type: mq4 nck-v1.0.mq4 (3.3 KB, 17 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
  #1466 (permalink)  
Old 04-26-2009, 04:34 AM
xtremfx's Avatar
Junior Member
 
Join Date: Jul 2008
Posts: 17
xtremfx is on a distinguished road
xpMa (NEED HELP)

codersguru,
I need your help n explain about your xpMa. See attached.
When i used your xpMa_v9-T3MA(12), that indicator dont work. That indicator not follow time running. I already used indicator T3MA(included) as per your XP Moving Average Settings from your website XP Worx - Custom MetaTrader (MQL4) Programming and Free Expert Advisors - Indicators - Libraries - Scripts - MetaTrader Extensions (c++ DLLs) and i follow your note.
Note: the T3MA.mq4, HMA.mq4, JMA.mq4, DECEMA_v1 and SALT (included) are required files for the Moving Average type 6, 7, 8, 9 and 10.
Or i need new T3MA?
Please help me to used your indicator....(HOPE)
Attached Images
File Type: gif xpma1.gif (66.2 KB, 110 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
  #1467 (permalink)  
Old 04-28-2009, 09:03 AM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 513
Shinigami is on a distinguished road
Quote:
Originally Posted by AceFX View Post
Ben,

Can't thank you enough for the quick and helpful reply. You were absolutely correct and I am a step closer because of it!

I do have one more question however, trying to add a break even point at a level less than the trailing stop but haven't gotten past:

extern bool UseBreak_Even = True;
extern int Break_Even = 20;

...

Any chance on some advice here as well?

Thanks again and take care!
-Ace
Hi, Breakeven is an easy function, you just need to understand what you need and then you'll be able to think of what you write to make it happen.
1. Breakeven = moving stoploss to order open price when stoploss is below open (for buy, above open for sell).
To check if its below we usually use this: OrderStopLoss()<OrderOpenPrice()
2. Before you move to breakeven you need to check if conditions are true. I use something like this:
if(bid>orderopenprice()+breakeven*point) move
3. Moving. I use something like this:
ordermodify(symbol(),bla-bla-bla,,,stoploss,takeprofit,0);
bla-bla-bla = set of parameters that don't change for opened orders like order open price (can be changed for pending orders)
stoploss = I usually put orderopenprice() here to that the order is closed at 0 pip profit.
takeprofit = if you don't want TP to change, just enter OrderTakeProfit() (case sensitive!)

Hope this helps and yes it leaves you to do the job yourself.
Oh, and how to find the order you want to modify:
Code:
for(int i=0;i<=OrdersTotal();i++) {
if(!OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) continue;
if(OrderSymbol()!=Symbol()) continue;
if(OrderMagicNumber!=MagicNumber) continue;
if(your-condition-here) your-action-here;
}
That should do the job just fine this cycle simply cycles through orders and finds each and every order currently opened. It then filters out orders with different magic number (you'll need to define magic number first) and those with different symbol (currency pair).
Hope this helps

nck
thanks but the code is useless without the goldminer1 and goldminer2 indicators
New EA is attached. Couldn't test it for obvious reasons so please don't blame me if it doesn't work the way it should. It should close existing order when a new signal is received but there could be a conflict of signals because different indicators are used for buy and sell.
Have fun with the new EA!
Attached Files
File Type: mq4 nck-v1.1 Shinigami.mq4 (3.8 KB, 12 views)
__________________
MQL4 programming is easy ^^

Last edited by Shinigami; 04-28-2009 at 09:33 AM. Reason: EA added
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
  #1468 (permalink)  
Old 04-28-2009, 11:01 PM
Junior Member
 
Join Date: Apr 2009
Posts: 5
atkfam is on a distinguished road
Trade size per tick or bar in MT4

Hi,

I hope someone with good knowledge of MT4 internals can answer my question and this answer might benefit everybody: I cannot find anywere how to get a trade size for incoming ticks or for a bar. This seems to be a basic market characteristic but MarketInfo function does not provide it. Is it possible in MT4 at all?

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
  #1469 (permalink)  
Old 04-29-2009, 09:06 AM
Senior Member
 
Join Date: Dec 2006
Location: Ukraine
Posts: 513
Shinigami is on a distinguished road
Quote:
Originally Posted by atkfam View Post
Hi,

I hope someone with good knowledge of MT4 internals can answer my question and this answer might benefit everybody: I cannot find anywere how to get a trade size for incoming ticks or for a bar. This seems to be a basic market characteristic but MarketInfo function does not provide it. Is it possible in MT4 at all?

Thanks
double Volume[]
Series array that contains tick volumes of each bar of the current chart.

double iVolume( string symbol, int timeframe, int shift)
Returns Tick Volume value for the bar of indicated symbol with timeframe and shift. If local history is empty (not loaded), function returns 0.
For the current chart, the information about bars tick volumes is in the predefined array named Volume[].

Is this what you were looking for? Volumes are based on number of ticks received during the bar, might be generated during back-test, differ for every broker. I'm afraid they don't have much value.
__________________
MQL4 programming is easy ^^
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
  #1470 (permalink)  
Old 04-29-2009, 09:53 AM
Junior Member
 
Join Date: Apr 2009
Posts: 5
atkfam is on a distinguished road
Trade size per tick or bar in MT4

Shinigami,

Thanks for you response but I am looking for actual trade size associated with each tick. Each tick seems to be a buy/sell transaction and I really would like to know the actual size of such a transaction. Is it 100 standard lots or 1 lot or microlot? It makes a difference.
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
forex, histogram, JMASlope, ToR 1.20, ZUP_v1.mq4


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 03:29 PM.



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