Systems created with Zero Code beta 1
  #1 (permalink)  
Old 06-12-2005, 11:50 AM
Belzebut's Avatar
Sophomore
 
Join Date: Jun 2005
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Belzebut is a jewel in the roughBelzebut is a jewel in the roughBelzebut is a jewel in the roughBelzebut is a jewel in the rough
Send a message via MSN to Belzebut
Lightbulb Systems created with Zero Code beta 1

I created this thread to gather all systems and backtests make with Zero Code beta 1


So there is a simple system (long term system, 31 trades in 4 years) :

For eurusd 4h

- Price crosses ma 20
- Stochastic crosses up or down
- Macd crosses up or down

No stop loss
No take profit
100 pips trailing stop

Backtest start 26/04/2001 with 10000 dollars

Best result : 428 %

But the metatrader backtester close the last trade at - 8290 dollars so it reduce the result at 245 % (normally the trade will be always open but the backtesting processus close it)






Without my customs indicators, and my pivots i can't do anything
However i don't know how we can do to make the pivots on automatic trade, because it's a very discretionary system

I just post an idea and to say that we can create system that works with the amazing Zero Code, but this program need little update


We can try this system on shorter time frames, by adding an adx filter (you enter long and short only when adx is rising)

Please give many systems in this thread

Last edited by Belzebut : 06-12-2005 at 12:13 PM.
Reply With Quote
  #2 (permalink)  
Old 06-12-2005, 12:17 PM
Freshman
 
Join Date: Jun 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
yasirdxb is on a distinguished road
Default

Hi Belzebut,

wow! great system!

Sorry for this silly question. I'm a big zero when it comes to programming!

how can I write a logic that will open a trade when the price closes above

MA 'x' and close the trade when price closes below MA 'y'?

Thanks in advance,

Yasir.
Reply With Quote
  #3 (permalink)  
Old 06-12-2005, 09:29 PM
Ravique's Avatar
Super Moderator
 
Join Date: Sep 2004
Posts: 404
Thanks: 2
Thanked 1 Time in 1 Post
Ravique is a name known to allRavique is a name known to allRavique is a name known to allRavique is a name known to allRavique is a name known to allRavique is a name known to all
Send a message via Yahoo to Ravique
Default

I can tell you the last trade thing. You see, when you are ttrading without a stoploss, and ( or ) without any exit criteria , there will be some positions , which just wont be profitable. They are summed up in the last trade. So they were opened, but never got to the 100 pips, so trailing stop could not been enabled. Possible solutions:


-Add a stop loss
-Add some closing position criteria ( for example , macd is crossing back, or stochastic is closing back and so on )
- Lower the trailing stop level, from say 100 pips to 50 pips.

I would prefer a combination of an exit criteria and reduced trailing stop. Only to get the best exit criteria you have to do some research. Let us know how it goes.
__________________
Regards,
Ravique
Reply With Quote
  #4 (permalink)  
Old 06-13-2005, 06:58 AM
Belzebut's Avatar
Sophomore
 
Join Date: Jun 2005
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Belzebut is a jewel in the roughBelzebut is a jewel in the roughBelzebut is a jewel in the roughBelzebut is a jewel in the rough
Send a message via MSN to Belzebut
Default

Ok Ravique, i wasn't know that all unprofitable trades are summed up in last trade, thanks

But as i say, it's just a little try of Zero Code beta 1.

Because without our customs indicators we are poor guys
Reply With Quote
  #5 (permalink)  
Old 06-13-2005, 07:07 AM
Belzebut's Avatar
Sophomore
 
Join Date: Jun 2005
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Belzebut is a jewel in the roughBelzebut is a jewel in the roughBelzebut is a jewel in the roughBelzebut is a jewel in the rough
Send a message via MSN to Belzebut
Default

Yasirdxb, this is for you :



I think this is right, but i ask confirmation to old members

Actually I think Zero Code can recognize when the price crosses with ma, and not when he closes up or down the ma ????

Last edited by Belzebut : 06-13-2005 at 07:10 AM.
Reply With Quote
  #6 (permalink)  
Old 06-13-2005, 08:25 AM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,957
Thanks: 113
Thanked 380 Times in 151 Posts
scorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to behold
Send a message via MSN to scorpion Send a message via Yahoo to scorpion
Default

Ok, below code is to Buy when bid price closes above MA(1) and Close the position when bid price closes below MA(1).

Note that I use "Volume < 10" to check for a new candle.
Attached Images
File Type: png zerocode_5.png (18.7 KB, 137 views)
Shark EA Ultimate
Actual Profits on Live Account: +975%
Since Jan 2007. View Live Statements.
__________________
Make easy pips with the Advanced Economic Calendar for Forex Trading.
Reply With Quote
  #7 (permalink)  
Old 06-13-2005, 08:28 AM
scorpion's Avatar
Administrator
 
Join Date: Aug 2004
Posts: 1,957
Thanks: 113
Thanked 380 Times in 151 Posts
scorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to beholdscorpion is a splendid one to behold
Send a message via MSN to scorpion Send a message via Yahoo to scorpion
Default

Quote:
Originally Posted by Ravique
I can tell you the last trade thing. You see, when you are ttrading without a stoploss, and ( or ) without any exit criteria , there will be some positions , which just wont be profitable. They are summed up in the last trade. So they were opened, but never got to the 100 pips, so trailing stop could not been enabled.
Is that a bug of MetaTrader Backtester? I don't know that thing before.
__________________
Make easy pips with the Advanced Economic Calendar for Forex Trading.
Reply With Quote
  #8 (permalink)  
Old 06-13-2005, 08:33 AM
Ravique's Avatar
Super Moderator
 
Join Date: Sep 2004
Posts: 404
Thanks: 2
Thanked 1 Time in 1 Post
Ravique is a name known to allRavique is a name known to allRavique is a name known to allRavique is a name known to allRavique is a name known to allRavique is a name known to all
Send a message via Yahoo to Ravique
Default

Well, it is not a bug. C for yourself. If an expert open positions , and has no exit criteria or stopp loss , then theese positions would be open until they will reack take profit , or until they will eat your account up. So the backtester just closes them at the end of backtesting and this last trade shows the actual opened position loss. Maybe someday they will be profitable, they say that the market goes up and down always.
__________________
Regards,
Ravique
Reply With Quote
  #9 (permalink)  
Old 06-13-2005, 01:46 PM
Freshman
 
Join Date: Jun 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
yasirdxb is on a distinguished road
Default

Thank you very much Guys

I created a simple trend following strategy! but when i tried to include both buying and selling logic to one expert, it was not working correct. may be I am wrong.

please check this for me.

Here is what I wanted,

Buy when price closes above 89 ema high

close when price closes below 21 em low
-------------------------------------
Sell when price closes below 89 ema low

close when price closes above 21 ema high
==============================
I have attached the expert and screenshots. Please tell me how can I include both logics to one expert.
================================================== ====


//*---------------------------------------------------------------------------------------------------------*\
// This MQL is automatically generated by FXFisherman ZeroCode v1.0.1982.33196 (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 := Trend trader
Author := Yasir
Link := Coded_by_FXFisherman_ZeroCode_@www.fxfisherman.com
Lots := 1
Stop Loss := 0
Take Profit := 0
Trailing Stop := 0
]]*/
defines: Slippage(3);
defines: ;
var: cnt(0),IsBuying(False),IsSelling(False),IsClosing( False),RealTP(0),RealSL(0);
var: ma1_1(0),ma1_0(0),ma2_1(0),ma2_0(0);

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

// Calculate indicators' value
ma1_1 = iMAEx(89,MODE_EMA,0,PRICE_HIGH,1);
ma1_0 = iMAEx(89,MODE_EMA,0,PRICE_HIGH,0);
ma2_1 = iMAEx(21,MODE_EMA,0,PRICE_LOW,1);
ma2_0 = iMAEx(21,MODE_EMA,0,PRICE_LOW,0);


// Check for BUY, SELL, and CLOSE signal
IsBuying = (PriceBid > ma1_0)
and (Volume < 10);
IsSelling = False;
IsClosing = (PriceBid < ma2_0)
and (Volume < 10);

// 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(c nt,VAL_LOTS),Bid,3,Violet);
Alert("Trend trader: 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(c nt,VAL_LOTS),Ask,3,Violet);
Alert("Trend trader: 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*TrailingSt op) then
{
ModifyOrder(OrderValue(cnt,VAL_TICKET),OrderValue( cnt,VAL_OPENPRICE),
Ask+Point*TrailingStop,OrderValue(cnt,VAL_TAKEPROF IT),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("Trend trader: 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,R ED);
Alert("Trend trader: Selling");
};
};


//-------------- Coded by FXFisherman ZeroCode v1.0.1982.33196
================================================== ==
Attached Images
File Type: jpg graph.JPG (66.8 KB, 136 views)
File Type: jpg report.JPG (50.7 KB, 131 views)
Reply With Quote
  #10 (permalink)  
Old 06-22-2005, 04:01 AM
TraderSeven's Avatar
Sophomore
 
Join Date: Jun 2005
Posts: 86
Thanks: 0
Thanked 1 Time in 1 Post
TraderSeven is a glorious beacon of lightTraderSeven is a glorious beacon of lightTraderSeven is a glorious beacon of lightTraderSeven is a glorious beacon of lightTraderSeven is a glorious beacon of light
Default

Hi bezlebut,

Can you post the equity curve of the system?
For me the smoothness of that curve is very important.

About closing the last open trade.
I agree with you it shouldn't be in the calulations.
We would need and extra 'unrealized p/l' entry.
But the report is medicore are best anyway.
Everything is calculated with the amount of cash in your account.
($10000)
But in reality the system only uses $1000 + required margin.
__________________
If your system fails just swap long & short :whistling
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Download ZeroCode Beta 1 scorpion MetaTrader and ZeroCode 16 06-30-2008 09:40 PM
Trading E-Books Download jgrimney Tutorials, Tips & Tricks 46 09-28-2007 07:32 PM
Zero code beta 2 suggestions Belzebut MetaTrader and ZeroCode 0 06-12-2005 09:40 AM


All times are GMT. The time now is 10:44 PM.
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0

Registered members have access to special online forex currency trading tools, software, mt4 expert advisors and indicators. Register now

Main Menu

Economic Forecast