Hm, interesante idea.
Thanks for sharing this nice expert advisor. Here is a modified version with risk management.
two problems:
1. no stoploss, dangerous
2. it judge the condition at the begin of bar, how do you know the High[0] in the begin of the bar, as my thought H[0]<= H[1] at the begin of a new bar
so I am wondering whether the ea uses the future data
two problems:
1. no stoploss, dangerous
2. it judge the condition at the begin of bar, how do you know the High[0] in the begin of the bar, as my thought H[0]<= H[1] at the begin of a new bar
so I am wondering whether the ea uses the future data
With English for me quite in any way, but
1. there is a parameter of Stoploss, specify the desired value and will you be proposed feet
2. in a code error in relation to description it is correct it would be to write down a condition:
if (Low[0]>Low[1]&&Low[1]>Low[2]&&Low[2]>Low[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3])
BuyOp=true;
if (High[0]<High[1]&&High[1]<High[2]&&High[2]<High[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3])
SellOp=true;
two problems:
1. no stoploss, dangerous
2. it judge the condition at the begin of bar, how do you know the High[0] in the begin of the bar, as my thought H[0]<= H[1] at the begin of a new bar
so I am wondering whether the ea uses the future data
With English for me quite in any way, but
1. there is a parameter of Stoploss, specify the desired value and will you be proposed feet
2. in a code error in relation to description it is correct it would be to write down a condition:
if (Low[0]>Low[1]&&Low[1]>Low[2]&&Low[2]>Low[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3])
BuyOp=true;
if (High[0]<High[1]&&High[1]<High[2]&&High[2]<High[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3])
SellOp=true;
hi,
I still have question as below
Since the ea only judge the condition in the begin of the bar, Low[0]>Low[1] (High[0]<High[1]) should always be right (assume no gap for current bar open). So can we remove Low[0]>Low[1] (High[0]<High[1]) and see the results?
I am not clear about how mt4 explain High[0] and Low[0], just wondering whether it will use the future data.
Thanks for your explaination and further discussion. ^_^
two problems:
1. no stoploss, dangerous
2. it judge the condition at the begin of bar, how do you know the High[0] in the begin of the bar, as my thought H[0]<= H[1] at the begin of a new bar
so I am wondering whether the ea uses the future data
With English for me quite in any way, but
1. there is a parameter of Stoploss, specify the desired value and will you be proposed feet
2. in a code error in relation to description it is correct it would be to write down a condition:
if (Low[0]>Low[1]&&Low[1]>Low[2]&&Low[2]>Low[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3])
BuyOp=true;
if (High[0]<High[1]&&High[1]<High[2]&&High[2]<High[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3])
SellOp=true;
One more suggestion, can we modify as below
if (Low[0]<Low[1]&&Low[1]<Low[2]&&Low[2]<Low[3]&&Open[0]<Open[1]&&Open[1]<Open[2]&&Open[2]<Open[3])
SellOp=true;
if (High[0]>High[1]&&High[1]>High[2]&&High[2]>High[3]&&Open[0]>Open[1]&&Open[1]>Open[2]&&Open[2]>Open[3])
BuyOp=true;
It may like a breakup, the difference is that this can not be only in the begin of the bar. Not sure the results.
Great idea,
have checked it with live history data from various brokers and it works very well.
With additional MM and time sensitive settings it would be perfect.
Thank you so much.
Regards
I am a bit new to this I muct admit, however when i loaded the OpenTicks, I did not get these results at all. Is their something in the set up I am missing?
Thank you!
this is not but another version of adding up strategy
put random numbers for buying adn selling and you get the same results
//+------------------------------------------------------------------+ //| OpenTiks.mq4 | //| Copyright © 2008, ZerkMax | //| zma@mail.ru | //+------------------------------------------------------------------+ #property copyright "Copyright © 2008, ZerkMax" #property link "zma@mail.ru" extern int Shift1 = 0; extern int Shift2 = 1; extern int Shift3 = 2; extern int Shift4 = 3; extern int TrailingStop = 30; extern int StopLoss = 0; extern double Lots = 0.1; extern bool RiskManagement=false; //money management extern double RiskPercent=10; //risk in percentage extern int magicnumber = 777; extern bool PolLots = true; extern int MaxOrders = 1; int prevtime; //+------------------------------------------------------------------+ //| expert initialization function | //+------------------------------------------------------------------+ int init() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- //---- return(0); } //+------------------------------------------------------------------+ //| expert start function | //+------------------------------------------------------------------+ int start() { //---- //risk management bool MM=RiskManagement; if(MM){if(RiskPercent<0.1||RiskPercent>100){Comment("Invalid Risk Value.");return(0);} else{Lots=MathFloor((AccountFreeMargin()*AccountLeverage()*RiskPercent*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)* MarketInfo(Symbol(),MODE_MINLOT)))*MarketInfo(Symbol(),MODE_MINLOT);}} if(MM==false){Lots=Lots;} int i=0; int total = OrdersTotal(); for(i = 0; i <= total; i++) { if(TrailingStop>0) { OrderSelect(i, SELECT_BY_POS, MODE_TRADES); if(OrderMagicNumber() == magicnumber) { TrailingStairs(OrderTicket(),TrailingStop); } } } bool BuyOp=false; bool SellOp=false; MathSrand(TimeLocal()); double r=MathRand()/32767; //if (High[Shift1]>High[Shift2]&&High[Shift2]>High[Shift3]&&High[Shift3]>High[Shift4]&&Open[Shift1]>Open[Shift2]&&Open[Shift2]>Open[Shift3]&&Open[Shift3]>Open[Shift4]) BuyOp=true; //if (High[Shift1]<High[Shift2]&&High[Shift2]<High[Shift3]&&High[Shift3]<High[Shift4]&&Open[Shift1]<Open[Shift2]&&Open[Shift2]<Open[Shift3]&&Open[Shift3]<Open[Shift4]) SellOp=true; if (r>=0.5) BuyOp=true; if (r<0.5) SellOp=true; if(Time[0] == prevtime) return(0); prevtime = Time[0]; if(!IsTradeAllowed()) { prevtime = Time[1]; return(0); } if (total < MaxOrders || MaxOrders == 0) { if(BuyOp) { if (StopLoss!=0) { OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Bid-(StopLoss*Point),0,"OpenTiks_Buy",magicnumber,0,Green); } else { OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,0,"OpenTiks_Buy",magicnumber,0,Green); } } if(SellOp) { if (StopLoss!=0) { OrderSend(Symbol(),OP_SELL,Lots,Bid,3,Ask+(StopLoss*Point),0,"OpenTiks_Sell",magicnumber,0,Red); } else { OrderSend(Symbol(),OP_SELL,Lots,Bid,3,0,0,"OpenTiks_Sell",magicnumber,0,Red); } } } //---- return(0); } //+------------------------------------------------------------------+ void TrailingStairs(int ticket,int trldistance) { int Spred=Ask - Bid; if (OrderType()==OP_BUY) { if((Bid-OrderOpenPrice())>(Point*trldistance)) { if(OrderStopLoss()<Bid-Point*trldistance || (OrderStopLoss()==0)) { OrderModify(ticket,OrderOpenPrice(),Bid-Point*trldistance,OrderTakeProfit(),0,Green); if (PolLots) if (NormalizeDouble(OrderLots()/2,2)>MarketInfo(Symbol(), MODE_MINLOT)) { OrderClose(ticket,NormalizeDouble(OrderLots()/2,2),Ask,3,Green); } else { OrderClose(ticket,OrderLots(),Ask,3,Green); } } } } else { if((OrderOpenPrice()-Ask)>(Point*trldistance)) { if((OrderStopLoss()>(Ask+Point*trldistance)) || (OrderStopLoss()==0)) { OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*trldistance,OrderTakeProfit(),0,Red); if (PolLots) if (NormalizeDouble(OrderLots()/2,2)>MarketInfo(Symbol(), MODE_MINLOT)) { OrderClose(ticket,NormalizeDouble(OrderLots()/2,2),Bid,3,Green); } else { OrderClose(ticket,OrderLots(),Bid,3,Green); } } } } }
Hii
Beautifull ea.... Thank you..
[URL=http://imageshack.us][IMG]http://img220.imageshack.us/img220/9898/eatikkgu8.jpg[/IMG][/URL]
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
OpenTiks:
Author: Maksim Zerkalov