MQL Code Maker

 

Hey,

Now besides live testing fxfisherman and tweaking main systems, I have some time to spare, so I'd like to create a useful piece of software for all traders. I'm thinking of creating a MT Expert Code Maker for non-programmers which lets them create experts without the need of programming skill. I'm sure that it will be very popular among traders, because of its ease of use. The users don't need to write a line of code; they just define simple rules for BUY, SELL, and CLOSE in simple graphical interface, and then the program generates MQL for you. For example:

Sample '10 Minutes' System's rules
BUY EURUSD WHEN WMA1 cross up SMA1
AND MACD Histogram > 0
AND MACD Histogram > MACD
AND RSI > 50
AND Stoch. D > Stoch. K

SELL EURUSD WHEN WMA1 cross down SMA1
AND MACD Histogram < 0
AND MACD Histogram < MACD
AND RSI < 50
AND Stoch. D < Stoch. K

Eventually, everyone can enjoy creating their own expert in a few minutes!

 

Wow that sounds awesome!!

I'm this has limits though using calculations behind with the code. For example if one did not have a pivot point indicator then all the coding would be behind in the code. So what you are making is pretty extensive as long as an indicator works.

I wish you the best of luck and I'll be a beta tester if you want :-D Maybe you can also add your own backtester? That would make you god of Forex!

 

Heh Gazuz, if this program is out then you can fine-tune your CCI system the way you want without ever asking for help like before. Maybe, newbies will ask you to code mql for 'em instead.

Ok, I like the name "FXFisherman ZeroCode". In version 1, the program should produce MQL (MQLII) and if possible MQH (MQL4).

Users will need to go through only 3 short & simple steps (a few mouse clicks + a few keystrokes):

1. Indicators setup

2. Trade Rule

3. Settings (System Name, Author Name, Trading Period, Before-Weekend Close, Default SL/TP, etc)

 

That is a very nice idea, and i am sure that it will be very useful for traders like me, gazuz and others. Ready to be the second beta tester after Gazuz

 

Hey,

Good news! ZeroCode is almost finished. Only graphical user interface is left to code.

Below is a sample MACD crossover system generated by ZeroCode for the first time! I can tell you that below code looks so tidy. In the future, we can expect ZeroCode to be an error-free software that help all traders especially non-programmers to put simple-complex idea into code in just 2 minutes!

If you have some time, live test this expert.



//*---------------------------------------------------------------------------------------------------------*\
// This MQL is automatically generated by FXFisherman ZeroCode v1.0.1978.27476 (www.fxfisherman.com)
//
// DISCLAIMER:
//
// FXFisherman ZeroCode is provided free of charge, and, therefore, on an "as is" basis, without warranty
// of any kind, express or implied, including without limitation the warranties that it is free of defects,
// virus free, able to operate on an uninterrupted basis, merchantable, fit for a particular purpose or
// non-infringing. In any case, the author(s) will not be responsible or liable for ANY SPECIAL, INCIDENTAL,
// CONSEQUENTIAL, INDIRECT OR ANY OTHER LOSSES caused by using of this software. USE IT AT YOUR OWN RISK.
//
//*-----------------------------------PLEASE DO NOT REMOVE THIS HEADER--------------------------------------*/

/*[[ Name := MACD Cross
Author := Scorpion
Link := Coded_by_FXFisherman_ZeroCode_@www.fxfisherman.com
Lots := 1
Stop Loss := 0
Take Profit := 0
Trailing Stop := 30
]]*/
defines: Slippage(3),;
var: cnt(0),IsBuying(False),IsSelling(False),IsClosing(False),RealTP(0),RealSL(0);
var: macd1signal_1(0),macd1histogram_0(0),macd1signal_0(0),macd1histogram_1(0);

// Check for invalid bars and takeprofit
If Bars<200 then Exit;

// Calculate indicators' value
macd1signal_1 = iMACDEx(12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);
macd1histogram_0 = iMACDEx(12,26,9,PRICE_CLOSE,MODE_MAIN,0);
macd1signal_0 = iMACDEx(12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);
macd1histogram_1 = iMACDEx(12,26,9,PRICE_CLOSE,MODE_MAIN,1);


// Check for BUY, SELL, and CLOSE signal
IsBuying = (macd1histogram_0 > macd1signal_0)
and (macd1histogram_1 < macd1signal_1);
IsSelling = (macd1histogram_0 < macd1signal_0)
and (macd1histogram_1 > macd1signal_1);
IsClosing = False;

// Control open trades
for cnt=1 to TotalTrades
{
// Control only market trades not entry order
if OrderValue(cnt,VAL_TYPE)<=OP_SELL and
OrderValue(cnt,VAL_SYMBOL)=Symbol then
{

// Check for close signal for bought trade
If OrderValue(cnt,VAL_TYPE)=OP_BUY then
{

If IsSelling or IsClosing then
{
// Close bought trade
CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Bid,3,Violet);
Alert("MACD Cross: Closing BUY order.");
};

// Check trailing stop
If TrailingStop>0 then
{
If (Bid-OrderValue(cnt,VAL_OPENPRICE))>(Point*TrailingStop) then
{
If OrderValue(cnt,VAL_STOPLOSS)<(Bid-(Point*TrailingStop)) then
{
// Modify trailing stop
ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_OPENPRICE),
Bid-(Point*TrailingStop),OrderValue(cnt,VAL_TAKEPROFIT),Red);
};
};
};
}
else
{

// Check sold trade for close signal
If IsBuying or IsClosing then
{
CloseOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_LOTS),Ask,3,Violet);
Alert("MACD Cross: Closing SELL order.");
};

// Control trailing stop
If TrailingStop>0 then
{
If (OrderValue(cnt,VAL_OPENPRICE)-Ask)>(Point*TrailingStop) then
{
If OrderValue(cnt,VAL_STOPLOSS)=0 or
OrderValue(cnt,VAL_STOPLOSS)>(Ask+(Point*TrailingStop)) then
{
comment(ask);
ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue(cnt,VAL_OPENPRICE),
Ask+(Point*TrailingStop),OrderValue(cnt,VAL_TAKEPROFIT),Red);
};
};
};
};
};
};


// If there is no open trade
If TotalTrades<1 then
{
// If we have enough money for 1 lot
If FreeMargin<1000 then Exit;

// Check for BUY entry signal
If IsBuying and IsSelling=False and IsClosing=False then
{
// Buy
If StopLoss>0 then
{
RealSL=Ask-StopLoss*Point;
}
If TakeProfit>0 then
{
RealTP=Ask+TakeProfit*Point;
}
SetOrder(OP_BUY,Lots,Ask, Slippage,RealSL,RealTP,RED);
Alert("MACD Cross: Buying");
};

// Check for SELL entry signal
If IsSelling and IsBuying=False and IsClosing=False then
{
// Sell
If StopLoss>0 then
{
RealSL=Bid+StopLoss*Point;
}
If TakeProfit>0 then
{
RealTP=Bid-TakeProfit*Point;
}
SetOrder(OP_SELL,Lots,Bid,Slippage,RealSL,RealTP,RED);
Alert("MACD Cross: Selling");
};
};


//-------------- Coded by FXFisherman ZeroCode v1.0.1978.27476

 

Hmm.... I have some problem here, I have try this expert in metatrader 3.83v. I but it in backtesting but it show no result, and I have try 1 hour live trading in 1min chart but there show no signal (may be there really don't have any signal at the moment) :sweatdrop

 

Ok, bug #1 is now fixed in 5 minutes. It was a miscalculation of TakeProfit. Now it's working.

 

Yup it really work now , but I have some question here, why I can't modify the value of "take profit" , "stop lose" and others in the metatrader ? Like I set "stop lose" at 30pips, but it won't function.

 

Am i missing something I can't find the file... I'd like to test this out.. maybe work on my CCi or something.

Let me know,

Thanks

EDIT: Nvm he was testing the expert not the program.. I thought i was being left out on something . I think I'll be roaming around the Yahoo Group picking up a dollar here and there.. and maybe even a successful expert or two . Keep in touch scorpion

 

Where possible download ZeroCode ?

 

arzuma. It is not finished yet. It is final stage of development. ( Right , scorpion ? )