You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thank you for the development guys, next week i will have more time to analyse it.
I just ask one thing if possible, post the mq4 versions, so everyone could check and modify the expert to their needs.
Thanks !i want it too for better and fast work on it,but i dont think altoronto will be like it,;)
i want it too for better and fast work on it,but i dont think altoronto will be like it,;)
I think he will share, because at first he uploaded the mq4 version (the one that doesn't work).
And if he doesn't, we'll wait Mladen's version
I think he will share, because at first he uploaded the mq4 version (the one that doesn't work).
And if he doesn't, we'll wait Mladen's versionyes,you are right but it looks as we twice are keen interested and in hurry,they are not,;)
Hi guys, please find mq4 versions.
Hi guys, please find mq4 versions.
oh man,many thanks,you looking more pretty than already,.......big joe and me will be test it when market opened but what i noticed by code,it is 5 digit broker compatible,and more thanks for adding price options,can you add order modify function too.so that it work with ecn/stp brokers with SL/TP......hope slowly slowly it will be move towards its destination.:)
altoronto,
sorry to write and paste these lines here,not a coding regarding thread but because it all is concerning to the EA matters,so with excuse i am trying to do it here.
though i do not know any thing about coding matters but here i found some thing concerning modifying order,TS and BE,may be help you,also i think every coder have his own way and style of coding,not a standardize and equal formula.
regards
------------------------------------------------------------------
void MoveTrailingStop()
{
int cnt,total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELL&&OrderSymbol()==Symbol()&& OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY)
{
if(TrailingStop>0){
if((NormalizeDouble(OrderStopLoss(),Digits)<Normal izeDouble(Bid-Point*(TrailingStop+TrailingStep),Digits))||(Order StopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Normali zeDouble(Bid-Point*TrailingStop,Digits),OrderTakeProfit(),0,Blu e);
return(0);
}
}
}
else
{
if(TrailingStop>0){
if((NormalizeDouble(OrderStopLoss(),Digits)>(Norma lizeDouble(Ask+Point*(TrailingStop+TrailingStep),D igits)))||(OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Normali zeDouble(Ask+Point*TrailingStop,Digits),OrderTakeP rofit(),0,Red);
return(0);
}
}
}
}
}
}
//|---------break even
void MoveBreakEven()
{
int cnt,total=OrdersTotal();
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
if(OrderType()<=OP_SELL&&OrderSymbol()==Symbol()&& OrderMagicNumber()==Magic)
{
if(OrderType()==OP_BUY)
{
if(BreakEven>0)
{
if(NormalizeDouble((Bid-OrderOpenPrice()),Digits)>BreakEven*Point)
{
if(NormalizeDouble((OrderStopLoss()-OrderOpenPrice()),Digits)<0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Normali zeDouble(OrderOpenPrice()+0*Point,Digits),OrderTak eProfit(),0,Blue);
return(0);
}
}
}
}
else
{
if(BreakEven>0)
{
if(NormalizeDouble((OrderOpenPrice()-Ask),Digits)>BreakEven*Point)
{
if(NormalizeDouble((OrderOpenPrice()-OrderStopLoss()),Digits)<0)
{
OrderModify(OrderTicket(),OrderOpenPrice(),Normali zeDouble(OrderOpenPrice()-0*Point,Digits),OrderTakeProfit(),0,Red);
return(0);
}
}
}
}
}
}
}
---------------------------------------------------
some of coding guidance concerning to 5 digit broker and slippage matters,the author advised to add global variables in start of an EA.................but i am sure,altoronto know it all already ...... just only i want,not to leave any thing empty that we needs for a perfect EA and up to dated for all future requirements.
all these lines i copy paste from different locations,so a coder can better understand how and where to possibly fit these.
regards
----------------------------------------------------------------
*Note you must know a LITTLE about coding to do this.
1. Add global variables (local will work but just use global)
define variables vPoint as double , and vSlippage as int,
i.e
int vSlippage;
double vPoint;
2. Paste this into your init routine:
//------------------------------------ ----------------------
if (Point == 0.00001)
{ vPoint = 0.0001; vSlippage = slippage *10;}
else {
if (Point == 0.001)
{ vPoint = 0.01; vSlippage = slippage *10;}
else vPoint = Point; vSlippage = slippage;
}
//------------------------------------ ----------------------
3. Replace any instance of *Point with *vPoint, and any instance of slippage with vSlippage
You can use find/replace to do this quickly and pretty easily.
That's it! Its basically what the the other guys have said, I just said it a bit differently in case someone didn't understand the previous postings.
Also I included slippage, because myself, I used to forget that all the time and kept getting 138 requote errors.
I hope this helps someone. I'd even be willing to answer a few questions or private messages, but please understand I respect my time and hope you do too.
================================================== =========================================
void start(){double xecn=1; if(Digits==5||Digits==3){xecn=10;}
================================================== ========================================
//++++ These are adjusted for 5 digit brokers.
double pips2points, // slippage 3 pips 3=points 30=points
pips2dbl; // Stoploss 15 pips 0.0015 0.00150
int Digits_pips; // DoubleToStr(dbl/pips2dbl, Digits.pips)
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
if (Digits == 5 || Digits == 3)
{ // Adjust for five (5) digit brokers.
pips2dbl = Point*10; pips2points = 10; Digits_pips = 1;
} else { pips2dbl = Point; pips2points = 1; Digits_pips = 0; }
}
================================================== ================================================== ==========
First at the top of your EA, just below the external variables declarations, put this line…
double dXPoint = 1;
Then in your init function add the following…
--------------------------------------------------------------------------------------------
Hello Altoronto,
I'm speaking here about your first version expert : ocnma v1
It's really a great step forward for me, and thank you so much, you are the first which bring an easy and elegant solution
BUT, i have a last small problem :
The current expert, doesn't close a trade when the slope change colors.
If you want : when we have a bad trade currently with a loss, normally the expert should close the trade when the slope change colors.
Can you make this little modification, i tried to do my best to trying for it, but nothing
Thanks a lot !
Big Joe and mntiwana, please find updated EA (using ocn nma smooth mtf 2.01 indicator) with all the bells and whistles like trailing stops, money management, basket trading, time filter, etc. Yes, and there is reason why I posted .ex4
Big Joe and mntiwana, please find updated EA (using ocn nma smooth mtf 2.01 indicator) with all the bells and whistles like trailing stops, money management, basket trading, time filter, etc. Yes, and there is reason why I posted .ex4
altoronto,
so much thanks man,for updating the EA step by step....one thing i like ask and say,let us work on any one version of nma,it looks we are dragging all two nma versions along with,"2.01 and 3_3" for to avoid confusion.:)
and as for reason providing ex4,dont worry,it is normal,important is,it is going ahead.
regards