|
|||||||
| 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 |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello Everybody,
I have a lot of problems in debuging the code written for MT4. So I thought of writting most of the code in a DLL file then import those function to my MQL4 code. The problem I am facing is that this method doesn't succeed for DLL's written in C#. Does anybody now where the problem could be? A demonstration code would be so much appreciated. I would also appreciate any other ideas for debugging MQL4 code. regrard, |
|
||||
|
Quote:
I've wrote the dll code in C++, maybe it helps! MT4 Files Functions Replacement. |
|
|||
|
Check My MQL4 Code please.
This is just a sample EA based on a price/simple MA cross. The reason I'm asking to get it checked out is because it's essentially the backbone of a few EA's I'm developing (the structure, not the strategy). All I need to do is verify that this EA will only trade on the completion of a bar. If someone can help me verify this, I'd appreciate it a lot. I'm still pretty new to MQL4 and just want to get this double checked before I go any further. I have about 4 EA's being developed @ the moment, and just want to be sure they execute trades correctly. In this case it would be only on a full bar.
In the EA one would only need to change EachTickMode to TRUE to make it trade tick by tick instead of bar by bar. Anyway, that's the idea. I'd appreciate any help. |
|
||||
|
hi
as you know, the MA indicator attachs to the main chart window, so it's scale will equal to price ratio, when you want to set a level=20, it means, you want to draw a horizontal line at 20 price ratio, the prices are too far from 20, so you can't see any line
__________________
there wil be nothig for a person exept his efforts (Emam Ali Alayhesalam) M.A.Gh |
|
||||
|
Good Question
Quote:
I just finished writing my first EA and tried testing it in Strategy Tester. I was getting errors showing in the ST journal so I tried using the Print function in my EA to debug the problems. I've worked out a few bugs so far this way, but it's a slow process. Last edited by BC Brett : 04-07-2006 at 08:38 PM. |
|
|||
|
Need help with very simple EA
Hi
I am trying to code a very simple EA to test a strategy. All it should do is open an order at a given time. Take Profit, Stop Loss and position size are external variables. I can't program but i tried to do it. This is what i have but it doesn't open any trades in backtest. Could anybody help me? Thanks a lot. Code:
//+------------------------------------------------------------------+
//| TH.mq4 |
//| Copyright © 2006, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"
//---- input parameters
extern int StartHour=0;
extern int StartMinute=00;
extern int TakeProfit=10;
extern int StopLoss=20;
extern int Lots=1;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
if (Hour()==StartHour && Minute() == StartMinute)
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,StopLoss,Ask+TakeProfit*Point,"TH_Buy",16384,0,Green);
}
//----
return(0);
}
//+------------------------------------------------------------------+
|
|
|||
|
The problem is with your stoploss. Your OrderSend statement should be written as:
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"TH_Buy",16384 ,0,Green); Also, for some brokers, it is not possible to use 10pips as takeprofit. You may have to increase it to 15pips. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to code this? | iscuba11 | Metatrader 4 mql 4 - Development course | 1 | 08-03-2007 04:22 PM |