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
  #2041 (permalink)  
Old 09-14-2009, 08:58 PM
SPACECHIMP's Avatar
Member
 
Join Date: Feb 2006
Location: West Michigan, USA.
Posts: 86
SPACECHIMP is on a distinguished road
Can't see the problem HERE!!!?? AAAAHHHH

I have no idea what i'm doing wrong..
this doesn't seem to close half at a certain TP

if (OrdersTotal()>0) {
OrderSelect(0, SELECT_BY_POS,MODE_TRADES);
Tick = OrderTicket(); // Number of selected order
Tip =OrderType(); // Type of selected order
Price =OrderOpenPrice(); // Price of selected order
Lot =OrderLots();
if (Bid >= (Price + (TakeProfit * Point)) && Lot == 2 && (Tip == OP_BUY)) {
OrderClose(Tick,1,Bid,10,Red); }
if (Ask <= (Price - (TakeProfit * Point)) && Lot == 2 && (Tip == OP_SELL)) {
OrderClose(Tick,1,Ask,10,Blue); }}

Do I have the BID and ASK correct? probably not
__________________
www.LiveTeamTrading.com
The FIRST LIVE Team trading Network Community for FOREX TRADERS! Ask me about Getting an Invite!
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
  #2042 (permalink)  
Old 09-16-2009, 10:28 AM
Junior Member
 
Join Date: Aug 2008
Posts: 14
omadivi is on a distinguished road
i need some help with my ea

i need a code to restrict my ea to only one trade. its a scalper, i only want one trade, after it makes, i put it off and attach it again the next day. can anyone help me on 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
  #2043 (permalink)  
Old 09-16-2009, 06:24 PM
Junior Member
 
Join Date: Sep 2009
Posts: 1
ForExTyro is on a distinguished road
Red face Where in this thread....

Somewhere in this thread this question had to have been asked...
Can someone help me with the code to 1) have a hidden SL that 2) only closes part (50%) of the open order and 3) closes the remainder of the order after it crosses a moving average.

Attached is an EA, but it's not in English, so I can't fully understand what it is doing or where to add my other code.


Thank you for your help.
Attached Files
File Type: mq4 !ytg_2MA_4Level.mq4 (8.5 KB, 4 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
  #2044 (permalink)  
Old 09-17-2009, 08:05 PM
Junior Member
 
Join Date: Aug 2008
Location: Sacramento
Posts: 10
kevin07 is on a distinguished road
How to Prevent Reloading Indicator at Every New Tic

Please tell me what I did wrong invoking iCustom that causes an indicator to load again with each new tic. (Backtesting fills the whole viewing window with hundreds of iterations of that indicator.)

From my "Start Program" I want to confirm a trade opportunity using EntryDir() method (which follows):

static datetime lastsd;

if ( CurTime()-lastsd>2*60*Period() )
{
if(ZZ>=High[1] && EntryDir()==OP_SELL)
{
if(pos == 1) {DoExit(OP_BUY);}

PrepNewOrder(OP_SELL);

lastsd=CurTime();
}

if(ZZ!=0 && ZZ<=Low[1] && EntryDir()==OP_BUY)
{
if(pos == -1) {DoExit(OP_SELL);}

PrepNewOrder(OP_BUY);

lastsd=CurTime();
}
}


int EntryDir()
{
bool buyOK=false, sellOK=false;

double flow = iCustom(NULL, 0, "Dtron", 0,0) + iCustom(NULL, 0, "Dtron" 1,0);
double trigger = iCustom(NULL, 0, "Dtron", 1,0) + iCustom(NULL, 0, "Dtron", 3,0);
double reversal = iCustom(NULL, 0, "Dtron", 4,0);

if((reversal==0 && flow + trigger>0) || reversal>0) entryDir=OP_BUY;
if((reversal==0 && flow + trigger<0) || reversal<0) entryDir=OP_SELL;

return(entryDir);
}

Please show me how to prevent causing hundreds of Dtron indicator windows from opening here.
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
  #2045 (permalink)  
Old 09-18-2009, 12:31 AM
Junior Member
 
Join Date: Sep 2008
Posts: 8
jimmynz is on a distinguished road
Angry Help with simple DLL call?

so all i want to do is get the MT4 Acc# from a dll.

Dll_call asks Dll_call_include for the "GetAccountNumber()" double from Dll_call.dll

simple right? the ea loads fine even with the wrong Acc# in the dll. Mt4 asks to use the dll.

the 3 files are in the right 3 folders, the dll is a .dll file (attached as a .txt to view code.

could someone please view the code for errors?

thanks
Attached Files
File Type: mq4 Dll_call.mq4 (973 Bytes, 3 views)
File Type: mqh Dll_call_include.mqh (544 Bytes, 2 views)
File Type: txt Dll_call.txt (629 Bytes, 6 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
  #2046 (permalink)  
Old 09-18-2009, 01:36 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 820
wolfe is on a distinguished road
Did you include GetAccountNumber in a .def file in your compiled dll? You have to do this for it to work.

Also, make sure Allow Dll imports is selected for your expert.

Hope this helps.

-wolfe
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
  #2047 (permalink)  
Old 09-18-2009, 10:28 PM
Junior Member
 
Join Date: Sep 2008
Posts: 8
jimmynz is on a distinguished road
im a bit new to C++ so i guess ill study def files. i read adding the def file to the librarys folder where the DLL is may solve this but no.
also read adding the DLL to the system32 folder, still no.

i plan to email this project to people so id rather not have to say how to place 4 different files all in different folders. is this the only way?

is the code in the 3 files right?
thanks alot
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
  #2048 (permalink)  
Old 09-18-2009, 11:08 PM
Junior Member
 
Join Date: Sep 2008
Posts: 8
jimmynz is on a distinguished road
this is the def file. look ok?
does it need to go in librarys with the DLL?
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
  #2049 (permalink)  
Old 09-19-2009, 01:34 AM
wolfe's Avatar
Senior Member
 
Join Date: Jan 2006
Posts: 820
wolfe is on a distinguished road
Quote:
Originally Posted by jimmynz View Post
this is the def file. look ok?
does it need to go in librarys with the DLL?
The .def file is part or your compiled c++ solution. I then copy my compiled c++ dll into the system32 folder in windows. I use a 32 bit system with windows xp.

I'm no expert in c++ either, but this is how I was able to make it work.
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
  #2050 (permalink)  
Old 09-19-2009, 03:22 AM
Junior Member
 
Join Date: Sep 2008
Posts: 8
jimmynz is on a distinguished road
thanks for the help, but still no.

werid thing is i tried making an EA with the usual code to check acc #:

int a = 907671;
int b = AccountNumber();
if (b != a) {
Alert("Checking Account No! (" + DoubleToStr(li_16, 0) + ") wrong Acc");
return (0)}

as an EA it loads no matter what the number is, but if i make it as an indi it works fine?

ggrrr
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)
 

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 07:59 PM.



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