zoop Posted January 23, 2010 Report Share Posted January 23, 2010 i have simple EMA ea, price above ema is a buy. price below ema is a sell here is the filter code //|---------moving average filter double MAF=iMA(Symbol(),0,MAPeriod,0,MAMethod,MAPrice,i); string MABUY="false";string MASELL="false"; if((MAFilter==false)||(MAFilter&&Bid>MAF))MABUY="true"; if((MAFilter==false)||(MAFilter&&Ask<MAF))MASELL="true"; question, how would i project ema status as comments showing up on mt4 graph? eg, price now above MAF- trade long price now below MAF- trade short thanks... Quote Link to comment Share on other sites More sharing options...
tom1713006007 Posted January 23, 2010 Report Share Posted January 23, 2010 Re: (Ask) How to get comments showing on MT4 i have simple EMA ea, price above ema is a buy. price below ema is a sell here is the filter code //|---------moving average filter double MAF=iMA(Symbol(),0,MAPeriod,0,MAMethod,MAPrice,i); string MABUY="false";string MASELL="false"; if((MAFilter==false)||(MAFilter&&Bid>MAF)) {MABUY="true";Comment ("price now above MAF- trade long");} if((MAFilter==false)||(MAFilter&&Ask<MAF)) {MASELL="true";Comment ("price now below MAF- trade short");} question, how would i project ema status as comments showing up on mt4 graph? eg, price now above MAF- trade long price now below MAF- trade short thanks... Hi zoop, just add the blue command I add to your original post. Including the { in front of MABUY="true"; and MASELL="true"; Hope this help you.. :D Quote Link to comment Share on other sites More sharing options...
zoop Posted January 23, 2010 Author Report Share Posted January 23, 2010 Re: (Ask) How to get comments showing on MT4 thanks tom for your help, one more question how to add MABUY and MASELL status to other comments already on the EA here is the code if(fullcomment) { //========Comment Start======= Comment ("","\n","\n","\n","\n","\n", "\n","...................................... ", "\n","MA adviser", "\n","...................................... ", "\n",( "Current Open Trade Profit/Loss is : ",AccountProfit()), "\n","...................................... ", "\n",( "Account Currency:",AccountCurrency()), "\n","...................................... ", "\n","Currency Spread is ",MarketInfo(Symbol(),MODE_SPREAD), "\n","...................................... ", "\n",( "Leverage 1:",AccountLeverage()), "\n","...................................... ", "\n",( "Account Balance:",AccountBalance()), "\n","...................................... ", "\n" ,"Current Broker Time Is ",TimeToStr(TimeCurrent())); } needing MABUY OR MASELL status to show after these thanks again! Quote Link to comment Share on other sites More sharing options...
tom1713006007 Posted January 23, 2010 Report Share Posted January 23, 2010 Re: (Ask) How to get comments showing on MT4 zoop, here is the code. Just add the blue command to your previous original EA. Please be precise with any of ; ) } etc.. Hope this help you ;) //|---------moving average filter double MAF=iMA(Symbol(),0,MAPeriod,0,MAMethod,MAPrice,i); string MABUY="false";string MASELL="false";string EAcomment; EAcomment= "No suggestion"; if((MAFilter==false)||(MAFilter&&Bid>MAF)) {MABUY="true";EAcomment ="Price now above MAF- trade long";} if((MAFilter==false)||(MAFilter&&Ask<MAF)) {MASELL="true";EAcomment ="Price now below MAF- trade short";} // Comment section ==================== if(fullcomment) { //========Comment Start======= Comment ("","\n","\n","\n","\n","\n", "\n","...................................... ", "\n","MA adviser", "\n","...................................... ", "\n",( "Current Open Trade Profit/Loss is : ",AccountProfit()), "\n","...................................... ", "\n",( "Account Currency:",AccountCurrency()), "\n","...................................... ", "\n","Currency Spread is ",MarketInfo(Symbol(),MODE_SPREAD), "\n","...................................... ", "\n",( "Leverage 1:",AccountLeverage()), "\n","...................................... ", "\n",( "Account Balance:",AccountBalance()), "\n","...................................... ", "\n" ,"Current Broker Time Is ",TimeToStr(TimeCurrent()) "\n\nEA suggestion: ", EAcomment ); } Quote Link to comment Share on other sites More sharing options...
zoop Posted January 23, 2010 Author Report Share Posted January 23, 2010 Re: How to get comments showing on MT4 thanks tom, all the other code seems to be fine, but just error message on this part "\n\nEA suggestion: ", EAcomment ); } 'EAcomment'-variable not defined thanks Quote Link to comment Share on other sites More sharing options...
4xinvestor Posted January 23, 2010 Report Share Posted January 23, 2010 Re: How to get comments showing on MT4 thanks tom, all the other code seems to be fine, but just error message on this part "\n\nEA suggestion: ", EAcomment ); } 'EAcomment'-variable not defined thanks Just add a semi colon after the EAComment and I think you'll be fine :-bd Quote Link to comment Share on other sites More sharing options...
San4x Posted January 23, 2010 Report Share Posted January 23, 2010 Re: How to get comments showing on MT4 thanks tom, all the other code seems to be fine, but just error message on this part "\n\nEA suggestion: ", EAcomment ); } 'EAcomment'-variable not defined thanks Don't forget to declare "EAcomment" as a string variable: string EAcomment; Quote Thanks for the kudos...much appreciated! Link to comment Share on other sites More sharing options...
zoop Posted January 24, 2010 Author Report Share Posted January 24, 2010 Re: How to get comments showing on MT4 thanks again tom and all i just moved string EAcomment; to above int init() { and its working great! Quote Link to comment Share on other sites More sharing options...
tom1713006007 Posted January 25, 2010 Report Share Posted January 25, 2010 Re: How to get comments showing on MT4 thanks again tom and all i just moved string EAcomment; to above int init() { and its working great! You are welcome zoop.. Glad to know that it help you.. :-bd Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.