Download MetaTrader 5
To add comments, please log in or register
Do you need a trading robot? Orderit via Freelance service!
Mccallum28
253
Mccallum28 2014.05.27 07:31 

Hi,


I would like to add the attached indicator to my EA using icustom.


What double would I have to declare for uptrend/downtrend ?


Thanks

Muzaffar Ergashaliev
9586
Muzaffar Ergashaliev 2016.11.07 08:40  
input int Nbars  = 1000;
input int FontSize  = 14;
double A = iCustom(_Symbol,PERIOD_CURRENT,"indicator name",Nbars,FontSize,Buffer)
ffoorr
985
ffoorr 2014.05.27 10:58  

use iCustom

exemple for up signal buffer 2 :

double up_signal_buffer_2 = EMPTY_VALUE ;

up_signal_buffer_2 = iCustom(NULL,0,"theflegacygtraderjmt4hindicator" , Nbars, FontSize, 2, 1); 

then

if( up_signal_buffer_2 != EMPTY_VALUE )

   {

Mccallum28
253
Mccallum28 2014.05.27 13:18  

Thanks ffoor,


I have adjusted the code but think I may have missed something.


It should open short if


 if((perceptron() < 0) && (TradeShort=True) &&(AW < 0 && red_AW != 0.0)  && ( down_signal_buffer_3 != EMPTY_VALUE ));


so signals all true. awesome indicator has a red bar and the legacy trader mt4 indicator has printed (Down Trend)


However its opening tickets in both directions. Can ou see the error|?


Thanks for your help

Mccallum28
253
Mccallum28 2014.05.27 13:28  
sorry attached now
whroeder1
13641
whroeder1 2014.05.27 17:09  
ryangillSL: I would like to add the attached indicator to my EA using icustom.
Detailed explanation of iCustom - MQL4 forum
Mccallum28
253
Mccallum28 2014.05.27 19:40  
you misunderstood, I have added the indicator using icustom. I have an error somewhere that I cant find. Just asking if someone can see it. Thanks for the link tho
ffoorr
985
ffoorr 2014.05.27 19:45  

   there is too much indicator, down_signal_buffer_3 is a signal, it happen at a bars that will not be the same bars than the red_AW != 0.0

 Trend and signal are not the same thing

 simplify, maybe, leave only the awesome indicator to fix the EA then add the other features

too much :

if((perceptron() < 0) && (TradeShort=True) &&(AW < 0 && red_AW != 0.0) && 
( down_signal_buffer_3 != EMPTY_VALUE ));<- delete that ;           

        

this line is sufficient, leave the perceptron for a while, until it work the way you wish, the perceptron give random signal,   :

if(AW < 0 && red_AW != 0.0)
  {
  ticket = OrderSend(Symbol(), OP_SELL, lots * 2, Bid, 3, Ask + sl * Point,0, "AI", MagicNumber, 0, Red); 



up_signal_buffer_2 = iCustom(NULL,0,"theflegacygtraderjmt4hindicator" , Nbars, FontSize, 2, 1); 
/
To add comments, please log in or register