10points 3.mq4 - page 339

 
pagebluk2007:
Hello everyone, I'm new to this thread.

I'm using 10p3v002 (thanks to David) TF 30M on IBFX and I'm intent to backtest with a micro account ($250). But instead of trading with 0.01 lot, it always constantly trade with 0.1 and 0.3 lot. Do i miss something here?

The profit itself was amazing, but I think it's too risky to trade with these number of lot. Here's my setting and detailed statement.

Tia, Don.

extern int Magic = 772188;

extern double TakeProfit = 10;

extern double Lots = 0.01;

extern double InitialStop = 160;

extern double TrailingStop = 0;

extern int MaxTrades = 10;

extern double Multiplier = 3;

extern int Pips = 5;

extern int OrderstoProtect = 4;

extern bool Money_management = true;

extern int AccountType = 2; //0: Standard account(NorthFinance,MiG,Alpari) 1: Normal account(FXLQ,FXDD) 2:InterbankFX's NANO Account

extern double risk = 0.5;

extern bool ReverseSignal = false;

extern int Fast_EMA = 12;

extern int Slow_EMA = 26;

extern int Signal_SMA = 9;

extern int Shift = 1;

extern int TradingRange = 0;

extern bool UseTimeFilter=true;

extern int StopTrade = 13;

extern int StartTrade = 18;

Is it possible that you forgot to select mini account when you setup the MQ4? If you did, just right click on "Accounts" select new and make sure that you change the account type to Mini.

All should be well, if that was the problem?

Cheers

Wayne

 
MANSTIR:
thank david for ya prompt reply..

i'm put '0' on take profit because i want my trailing stop do the job to take profit..

and there's no stoploss.. when the ea buy, modifying stoploss (trailing stop) were xtream good instead of sell/short (the problem is here -- sell/short no modify stoploss action!) why, i dunno...

10points3 is far greater than i thought...

this ea is remarkable result and i already foward testing to ensure its good....

once again the problem when the ea sell, no modify stoploss! i wonder why...

i'll try most of my time to fix it and sadly down to fail..

hmmm do i need to change a word BID to ASK to make it difference...if yes, i dun that remarks but no action..

Here is the backtest I made without changing a single thing. The code is working fine.

Regards

David

Files:
trailing.jpg  27 kb
003-trail.gif  7 kb
003-trail.htm  333 kb
 

Just 1 more quick reminder to all the traders. Live account holders of IBFX please becareful. Read this cautious!!! IBFX standard account comes with 1:100 leverage. If you decided to trade with 10p3v0 series, please bear in mind to reduce your risk in to half of your NANO account. Because normally NANO account comes with 1:200 leverage. If you can get the LiveChat personnel to help you change your standard account to 1:200, then its good for you to run with the same settings of your NANO account. Hope this help.

Regards

David

 
davidke20:
Here is the backtest I made without changing a single thing. The code is working fine.

Regards

David

hmmm what version youre using right now david, i'm using 10point4 versions

and can u share ur setting here..

 
davidke20:
No problem on my side with both NANO and normal accounts, please check my settings whether match with yours. Dont know why you have that problem.

Regards

David

thank you david,

hmmm maybe i'm using 10point4 versions, what versions you're using now... and can u share here your setting..

 
MANSTIR:
thank you david, hmmm maybe i'm using 10point4 versions, what versions you're using now... and can u share here your setting..

Version 0.03. You can find them at the earlier 30X pages(cant remember 306 or 309) Do some readings please. Settings are on the backtest report. When you wanted to test account balance below 1000, make sure you're testing it on the NANO condition(which is EURUSD comes with a "m" at the back - EURUSDm).

Regards

David

p/s: 10poin4 wasn't produce by me. Find another coder to help you out if you really needed to get things right on that particular version you mentioned.

 
KaMpeR:
Is it possible that you forgot to select mini account when you setup the MQ4? If you did, just right click on "Accounts" select new and make sure that you change the account type to Mini.

All should be well, if that was the problem?

Cheers

Wayne

You're right, my little silly mistake. Thank you Wayne!

 
pagebluk2007:
You're right, my little silly mistake. Thank you Wayne!

No problem, glad I could help, we are all human and mistakes are inevitable. :-)

Cheers

Wayne

 
davidke20:
Version 0.03. You can find them at the earlier 30X pages(cant remember 306 or 309) Do some readings please. Settings are on the backtest report. When you wanted to test account balance below 1000, make sure you're testing it on the NANO condition(which is EURUSD comes with a "m" at the back - EURUSDm).

Regards

David

p/s: 10poin4 wasn't produce by me. Find another coder to help you out if you really needed to get things right on that particular version you mentioned.

thanks again...mr david

 

Need Help With Ea

New here and dont know how to start new threads or anything so I am trading 10points3 and am trying to find someone to put a code in where i can have it trade only certain times of the day..I want it to stop trading at 7pm and start back up at 1600am..Please if anybody can help that would be awesome....

extern double TakeProfit = 10;

extern double Lots = 0.01;

extern double InitialStop = 80;

extern double TrailingStop = 0;

extern int MaxTrades=7;

extern int Pips=5;

extern int SecureProfit=0;

extern int AccountProtection=0;

extern int OrderstoProtect=0;

extern int ReverseCondition=0;

extern double EURUSDPipValue=10;

extern double GBPUSDPipValue=10;

extern double USDCHFPipValue=10;

extern double USDJPYPipValue=9.715;

extern int StartYear=2005;

extern int StartMonth=1;

extern int EndYear=2005;

extern int EndMonth=12;

extern int EndHour=22;

extern int EndMinute=30;

extern int mm=0;

extern int risk=12;

extern int AccountisNormal=0;

int OpenOrders=0, cnt=0;

int slippage=0;

double sl=0, tp=0;

double BuyPrice=0, SellPrice=0;

double lotsi=0, mylotsi=0;

int mode=0, myOrderType=0;

bool ContinueOpening=True;

double LastPrice=0;

int PreviousOpenOrders=0;

double Profit=0;

int LastTicket=0, LastType=0;

double LastClosePrice=0, LastLots=0;

double Pivot=0;

double PipValue=0;

string text="", text2="";

//+------------------------------------------------------------------+

//| expert initialization function |

//+------------------------------------------------------------------+

int init()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

//----

return(0);

}

//+------------------------------------------------------------------+

//| expert start function |

//+------------------------------------------------------------------+

int start()

{

//----

if (AccountisNormal==1)

{

if (mm!=0) { lotsi=MathCeil(AccountBalance()*risk/10000); }

else { lotsi=Lots; }

} else { // then is mini

if (mm!=0) { lotsi=MathCeil(AccountBalance()*risk/10000)/10; }

else { lotsi=Lots; }

}

if (lotsi>100){ lotsi=100; }

OpenOrders=0;

for(cnt=0;cnt<OrdersTotal();cnt++)

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if (OrderSymbol()==Symbol())

{

OpenOrders++;

}

}

/*

if (OpenOrders<1)

{

if (TimeYear(CurTime())<StartYear) { return(0); }

if (TimeMonth(CurTime())<StartMonth) { return(0); }

if (TimeYear(CurTime())>EndYear) { return(0); }

if (TimeMonth(CurTime())>EndMonth ) { return(0); }

}

*/

if (Symbol()=="EURUSD") { PipValue=EURUSDPipValue; }

if (Symbol()=="GBPUSD") { PipValue=GBPUSDPipValue; }

if (Symbol()=="USDJPY") { PipValue=USDJPYPipValue; }

if (Symbol()=="USDCHF") { PipValue=USDCHFPipValue; }

if (PipValue==0) { PipValue=5; }

if (PreviousOpenOrders>OpenOrders)

{

for(cnt=OrdersTotal();cnt>=0;cnt--)

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

mode=OrderType();

if (OrderSymbol()==Symbol())

{

if (mode==OP_BUY) { OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage,Blue); }

if (mode==OP_SELL) { OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),slippage,Red); }

return(0);

}

}

}

PreviousOpenOrders=OpenOrders;

if (OpenOrders>=MaxTrades)

{

ContinueOpening=False;

} else {

ContinueOpening=True;

}

if (LastPrice==0)

{

for(cnt=0;cnt<OrdersTotal();cnt++)

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

mode=OrderType();

if (OrderSymbol()==Symbol())

{

LastPrice=OrderOpenPrice();

if (mode==OP_BUY) { myOrderType=2; }

if (mode==OP_SELL) { myOrderType=1; }

}

}

}

if (OpenOrders<1)

{

myOrderType=3;

//if (iMACD(14,26,9,MODE_MAIN,0)>0 and iMACD(14,26,9,MODE_MAIN,0)>iMACD(14,26,9,MODE_MAIN,1)) then OrderType=2;

if (iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,0)>iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,1)) { myOrderType=2; }

//if (iMACD(14,26,9,MODE_MAIN,0)<0 and iMACD(14,26,9,MODE_MAIN,0)<iMACD(14,26,9,MODE_MAIN,1)) then OrderType=1;

if (iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,0)<iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,1)) { myOrderType=1; }

if (ReverseCondition==1)

{

if (myOrderType==1) { myOrderType=2; }

else { if (myOrderType==2) { myOrderType=1; } }

}

}

// if we have opened positions we take care of them

for(cnt=OrdersTotal();cnt>=0;cnt--)

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if (OrderSymbol() == Symbol())

{

if (OrderType()==OP_SELL)

{

if (TrailingStop>0)

{

if (OrderOpenPrice()-Ask>=(TrailingStop+Pips)*Point)

{

if (OrderStopLoss()>(Ask+Point*TrailingStop))

{

OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderClosePrice()-TakeProfit*Point-TrailingStop*Point,800,Purple);

return(0);

}

}

}

}

if (OrderType()==OP_BUY)

{

if (TrailingStop>0)

{

if (Bid-OrderOpenPrice()>=(TrailingStop+Pips)*Point)

{

if (OrderStopLoss()<(Bid-Point*TrailingStop))

{

OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderClosePrice()+TakeProfit*Point+TrailingStop*Point,800,Yellow);

return(0);

}

}

}

}

}

}

Profit=0;

LastTicket=0;

LastType=0;

LastClosePrice=0;

LastLots=0;

for(cnt=0;cnt<OrdersTotal();cnt++)

{

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if (OrderSymbol()==Symbol())

{

LastTicket=OrderTicket();

if (OrderType()==OP_BUY) { LastType=OP_BUY; }

if (OrderType()==OP_SELL) { LastType=OP_SELL; }

LastClosePrice=OrderClosePrice();

LastLots=OrderLots();

if (LastType==OP_BUY)

{

//Profit=Profit+(Ord(cnt,VAL_CLOSEPRICE)-Ord(cnt,VAL_OPENPRICE))*PipValue*Ord(cnt,VAL_LOTS);

if (OrderClosePrice()<OrderOpenPrice())

{ Profit=Profit-(OrderOpenPrice()-OrderClosePrice())*OrderLots()/Point; }

if (OrderClosePrice()>OrderOpenPrice())

{ Profit=Profit+(OrderClosePrice()-OrderOpenPrice())*OrderLots()/Point; }

}

if (LastType==OP_SELL)

{

//Profit=Profit+(Ord(cnt,VAL_OPENPRICE)-Ord(cnt,VAL_CLOSEPRICE))*PipValue*Ord(cnt,VAL_LOTS);

if (OrderClosePrice()>OrderOpenPrice())

{ Profit=Profit-(OrderClosePrice()-OrderOpenPrice())*OrderLots()/Point; }

if (OrderClosePrice()<OrderOpenPrice())

{ Profit=Profit+(OrderOpenPrice()-OrderClosePrice())*OrderLots()/Point; }

}

//Print(Symbol,":",Profit,",",LastLots);

}

}

Profit=Profit*PipValue;

text2="Profit: $"+DoubleToStr(Profit,2)+" +/-";

if (OpenOrders>=(MaxTrades-OrderstoProtect) && AccountProtection==1)

{

//Print(Symbol,":",Profit);

if (Profit>=SecureProfit)

{

OrderClose(LastTicket,LastLots,LastClosePrice,slippage,Yellow);

ContinueOpening=False;

return(0);

}

}

if (!IsTesting())

{

if (myOrderType==3) { text="No conditions to open trades"; }

else { text=" "; }

Comment("LastPrice=",LastPrice," Previous open orders=",PreviousOpenOrders,"\nContinue opening=",ContinueOpening," OrderType=",myOrderType,"\n",text2,"\nLots=",lotsi,"\n",text);

}

if (myOrderType==1 && ContinueOpening)

{

if ((Bid-LastPrice)>=Pips*Point || OpenOrders<1)

{

SellPrice=Bid;

LastPrice=0;

if (TakeProfit==0) { tp=0; }

else { tp=SellPrice-TakeProfit*Point; }

if (InitialStop==0) { sl=0; }

else { sl=SellPrice+InitialStop*Point; }

if (OpenOrders!=0)

{

mylotsi=lotsi;

for(cnt=1;cnt<=OpenOrders;cnt++)

{

if (MaxTrades>12) { mylotsi=NormalizeDouble(mylotsi*3,3); }

else { mylotsi=NormalizeDouble(mylotsi*3,3); }

}

} else { mylotsi=lotsi; }

if (mylotsi>100) { mylotsi=100; }

OrderSend(Symbol(),OP_SELL,mylotsi,SellPrice,slippage,sl,tp,NULL,0,0,Red);

return(0);

}

}

if (myOrderType==2 && ContinueOpening)

{

if ((LastPrice-Ask)>=Pips*Point || OpenOrders<1)

{

BuyPrice=Ask;

LastPrice=0;

if (TakeProfit==0) { tp=0; }

else { tp=BuyPrice+TakeProfit*Point; }

if (InitialStop==0) { sl=0; }

else { sl=BuyPrice-InitialStop*Point; }

if (OpenOrders!=0) {

mylotsi=lotsi;

for(cnt=1;cnt<=OpenOrders;cnt++)

{

if (MaxTrades>12) { mylotsi=NormalizeDouble(mylotsi*3,3); }

else { mylotsi=NormalizeDouble(mylotsi*3,3); }

}

} else { mylotsi=lotsi; }

if (mylotsi>100) { mylotsi=100; }

OrderSend(Symbol(),OP_BUY,mylotsi,BuyPrice,slippage,sl,tp,NULL,0,0,Blue);

return(0);

}

}

//----

return(0);

}

//+------------------------------------------------------------------+

Reason: