[Archive!] WRITING A COUNTRY TOGETHER!!! - page 26

 
Evgenich >> :

I didn't change anything in settings Lot 0.05 Depo share 0.3 EA gives error : invalid lots amount for OrderSend function. Maybe there is a way to set a fixed lot?


SHARE = 0 THEN IT WILL BE A FIXED ONE WHICH IS PRESCRIBED ... (>> NO CALCULATIONS.)

 
why is everyone so quiet? the topic seems to be far from over...
Files:
xxx.mq4  16 kb
 

test on one of the pairs this week with half deposit (0.6)

Bars in history 2146

246212 ticks simulated
Simulation quality 90.00%
Chart mismatch errors 41
Initial deposit 50.00
Net profit 3168.32
Total profit 3168.32
Total loss 0.00
Profitability
Expectation of winning 211.22
Absolute drawdown 11.51
Maximum drawdown 1234.53 (32.83%)
Relative drawdown 86.71% (251.23)
Total trades 15
Short positions (% win) 1 (100.00%)
Long positions (% win) 14 (100.00%)
Profitable trades (% of all) 15 (100.

00%)
Loss trades (% of all) 0 (0.00%)
Largest
profitable trade 1429.12
losing trade 0.00
Average
profitable trade 211.22
losing trade 0.00
Maximum
continuous wins (profit) 15 (3168.32)
continuous losses (loss) 0 (0.00)
Maximum
continuous gains (number of wins) 3168.32 (15)
continuous loss (number of losses) 0.00 (0)
Average
 
grail, for fuck's sake.)
 
sllawa3 писал(а) >>
What's going on? The topic is far from over...

I'm testering it, but it's not getting good results.

 

first of all this is a template ... First of all it is a template ... First of all it is a template which has unworkable trawl (only for a pair where it is hanging) Secondly it has very mild entry conditions ... trawl for all 6 pairs is given below ... Secondly it cannot be tested in tester without complete hole-free history for all 6 pairs ...


for(int k=0; k<=OrdersTotal(); k++)
{
if (OrderSelect(k,SELECT_BY_POS)==true)
{
if (OrderMagicNumber()!= Magic) continue;
//..................
if(OrderType() == OP_SELL&&OrderTakeProfit()==0)
{
t=MarketInfo(OrderSymbol(),MODE_BID)-TP*MarketInfo(OrderSymbol(),MODE_POINT);
OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),
t,OrderMagicNumber(), CLR_NONE);
}
if(OrderType() == OP_BUY&&OrderTakeProfit()==0)
{
t=MarketInfo(OrderSymbol(),MODE_ASK)+TP*MarketInfo(OrderSymbol(),MODE_POINT);
OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),
t,OrderMagicNumber(),CLR_NONE);
}
//.................
if(OrderType() == OP_SELL&&OrderStopLoss()==0)
{
s=MarketInfo(OrderSymbol(),MODE_ASK)+ SL*MarketInfo(OrderSymbol(),MODE_POINT);
OrderModify(OrderTicket(),OrderOpenPrice(),s,
OrderTakeProfit(),OrderMagicNumber(), CLR_NONE);
}
if(OrderType() == OP_BUY&&OrderStopLoss()==0)
{
s=MarketInfo(OrderSymbol(),MODE_BID)- SL*MarketInfo(OrderSymbol(),MODE_POINT);
OrderModify(OrderTicket(),OrderOpenPrice(),s,
OrderTakeProfit(),OrderMagicNumber(), CLR_NONE);
}
//................
if(OrdersTotal() > 0)
{
if(OrderType() == OP_SELL&&OrderMagicNumber() ==Magic)
{
if(TrailingStop> 0)
{
if(OrderOpenPrice() - MarketInfo(OrderSymbol(),MODE_ASK) >= TrailingStop * MarketInfo(OrderSymbol(),MODE_POINT))
{
if(OrderStopLoss() > (MarketInfo(OrderSymbol(),MODE_ASK) + MarketInfo(OrderSymbol(),MODE_POINT)* TrailingStop))
{

if(TrailingStop>0&&TrailingStop<MarketInfo(OrderSymbol(),MODE_STOPLEVEL))TrailingStop=MarketInfo(OrderSymbol(),MODE_STOPLEVEL);
OrderModify(OrderTicket(), OrderOpenPrice(),MarketInfo(OrderSymbol(),MODE_ASK) + MarketInfo(OrderSymbol(),MODE_POINT) * TrailingStop,
OrderTakeProfit(),OrderMagicNumber(), CLR_NONE);
}
}
}
}
else
if(OrderType() == OP_BUY&&OrderMagicNumber() ==Magic)
{
if(TrailingStop > 0)
{
if(MarketInfo(OrderSymbol(),MODE_BID) - OrderOpenPrice() >= TrailingStop * MarketInfo(OrderSymbol(),MODE_POINT))
{
if(OrderStopLoss() < (MarketInfo(OrderSymbol(),MODE_BID) - MarketInfo(OrderSymbol(),MODE_POINT) * TrailingStop))
{

if(TrailingStop>0&&TrailingStop<MarketInfo(OrderSymbol(),MODE_STOPLEVEL))TrailingStop=MarketInfo(OrderSymbol(),MODE_STOPLEVEL);
OrderModify(OrderTicket(), OrderOpenPrice(),MarketInfo(OrderSymbol(),MODE_BID) - MarketInfo(OrderSymbol(),MODE_POINT) * TrailingStop,
OrderTakeProfit(),OrderMagicNumber(), CLR_NONE);
}
}
}
}
}

if (OrderType()==OP_BUY&&CLOSE_BUY==true&&OrderMagicNumber() ==Magic)
{
if (iStochastic(OrderSymbol(),5,5,3,3, MODE_SMA, 0, MODE_SIGNAL,0)<iStochastic(OrderSymbol(),5,5,5,3,3, MODE_SMA, 0, MODE_SIGNAL,1)&&OrderOpenPrice()<iClose(OrderSymbol(),0,0)-MIN_PROFIT*MarketInfo(OrderSymbol(),MODE_POINT)
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),3)
}
if (OrderType()==OP_SELL&&CLOSE_SELL==true&&OrderMagicNumber() ==Magic)
{
if (iStochastic(OrderSymbol(),5,5,3,3,3, MODE_SMA, 0, MODE_SIGNAL,0)>iStochastic(OrderSymbol(),5,5,5,3,3, MODE_SMA, 0, MODE_SIGNAL,1)&&OrderOpenPrice()>iClose(OrderSymbol(),0,0)+MIN_PROFIT*MarketInfo(OrderSymbol(),MODE_POINT)
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),3)
}
}
}
return;
}



 

Hi all!

I've just come back from holiday...

Sea, sun and water are our best friends.

I've had a break and I'm ready to get back to work...

I suggest a specific topic to work on!

 
sllawa3 писал(а) >>

first of all this is a template ... it has a non-working trawl ( only on the pair where it hangs ) secondly the entry conditions are quite soft ... the trawl for all 6 pairs is given below ... secondly it cannot be tested in the tester without a complete hole-free history on all 6 pairs ...

for(int k=0; k<=OrdersTotal(); k++)
{
if (OrderSelect(k,SELECT_BY_POS)==true)
{
if (OrderMagicNumber()!= Magic) continue;
//..................
if(OrderType() == OP_SELL&&OrderTakeProfit()==0)
{
t=MarketInfo(OrderSymbol(),MODE_BID)-TP*MarketInfo(OrderSymbol(),MODE_POINT);
OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),
t,OrderMagicNumber(),CLR_NONE);
}
if(OrderType() == OP_BUY&&OrderTakeProfit()==0)
{
t=MarketInfo(OrderSymbol(),MODE_ASK)+TP*MarketInfo(OrderSymbol(),MODE_POINT);
OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),
t,OrderMagicNumber(),CLR_NONE);
}
//.................
if(OrderType() == OP_SELL&&OrderStopLoss()==0)
{
s=MarketInfo(OrderSymbol(),MODE_ASK)+ SL*MarketInfo(OrderSymbol(),MODE_POINT);
OrderModify(OrderTicket(),OrderOpenPrice(),s,
OrderTakeProfit(),OrderMagicNumber(), CLR_NONE);
}
if(OrderType() == OP_BUY&&OrderStopLoss()==0)
{
s=MarketInfo(OrderSymbol(),MODE_BID)- SL*MarketInfo(OrderSymbol(),MODE_POINT);
OrderModify(OrderTicket(),OrderOpenPrice(),s,
OrderTakeProfit(),OrderMagicNumber(), CLR_NONE);
}
//................
if(OrdersTotal() > 0)
{
if(OrderType() == OP_SELL&&OrderMagicNumber() ==Magic)
{
if(TrailingStop> 0)
{
if(OrderOpenPrice() - MarketInfo(OrderSymbol(),MODE_ASK) >= TrailingStop * MarketInfo(OrderSymbol(),MODE_POINT))
{
if(OrderStopLoss() > (MarketInfo(OrderSymbol(),MODE_ASK) + MarketInfo(OrderSymbol(),MODE_POINT)* TrailingStop))
{

if(TrailingStop>0&&TrailingStop<MarketInfo(OrderSymbol(),MODE_STOPLEVEL))TrailingStop=MarketInfo(OrderSymbol(),MODE_STOPLEVEL);
OrderModify(OrderTicket(), OrderOpenPrice(),MarketInfo(OrderSymbol(),MODE_ASK) + MarketInfo(OrderSymbol(),MODE_POINT) * TrailingStop,
OrderTakeProfit(),OrderMagicNumber(), CLR_NONE);
}
}
}
}
else
if(OrderType() == OP_BUY&&OrderMagicNumber() ==Magic)
{
if(TrailingStop > 0)
{
if(MarketInfo(OrderSymbol(),MODE_BID) - OrderOpenPrice() >= TrailingStop * MarketInfo(OrderSymbol(),MODE_POINT))
{
if(OrderStopLoss() < (MarketInfo(OrderSymbol(),MODE_BID) - MarketInfo(OrderSymbol(),MODE_POINT) * TrailingStop))
{

if(TrailingStop>0&&TrailingStop<MarketInfo(OrderSymbol(),MODE_STOPLEVEL))TrailingStop=MarketInfo(OrderSymbol(),MODE_STOPLEVEL);
OrderModify(OrderTicket(), OrderOpenPrice(),MarketInfo(OrderSymbol(),MODE_BID) - MarketInfo(OrderSymbol(),MODE_POINT) * TrailingStop,
OrderTakeProfit(),OrderMagicNumber(), CLR_NONE);
}
}
}
}
}

if (OrderType()==OP_BUY&&CLOSE_BUY==true&&OrderMagicNumber() ==Magic)
{
if (iStochastic(OrderSymbol(),5,5,3,3, MODE_SMA, 0, MODE_SIGNAL,0)<iStochastic(OrderSymbol(),5,5,5,3,3, MODE_SMA, 0, MODE_SIGNAL,1)&&OrderOpenPrice()<iClose(OrderSymbol(),0,0)-MIN_PROFIT*MarketInfo(OrderSymbol(),MODE_POINT)
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),3)
}
if (OrderType()==OP_SELL&&CLOSE_SELL==true&&OrderMagicNumber() ==Magic)
{
if (iStochastic(OrderSymbol(),5,5,3,3,3, MODE_SMA, 0, MODE_SIGNAL,0)>iStochastic(OrderSymbol(),5,5,5,3,3, MODE_SMA, 0, MODE_SIGNAL,1)&&OrderOpenPrice()>iClose(OrderSymbol(),0,0)+MIN_PROFIT*MarketInfo(OrderSymbol(),MODE_POINT)
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),3)
}
}
}
return;
}

Thanks for the clarifications, but I'm far from it and don't even know where to put it.

 

RomanS >> :

Hi all!

I've just come back from holiday...

Sea, sun and water are our best friends.

I've had a break and I'm ready to get back to work...

I suggest a specific topic to work on.


You could try a breakdown of the "morning flat"... or try just putting your own flat... 20pp, 50pp... either one (put 2 pendants)... When one pendent triggers, put the reverse one with doubling... Choose hours of operation... all should end up in the black... When a profit is reached ... for example 100usd, fix the profit and close all the orders ...)

And if you write a function to close the meeting orders, then it will be a beautiful story ...)

 
RomanS писал(а) >>

Hi all!

I've just come back from holiday...

Sea, sun and water are our best friends.

I've had a break and I'm ready to get back to work...

I propose to come up with a specific theme that we'll work on!

I can offer you to write an Expert Advisor on this strategy, in Bookkeeper document. Everything else you need is in the archive too.

Files:
kmqjldjbj.rar  603 kb