- This topic has 1 reply, 2 voices, and was last updated 4 years, 10 months ago by
Yannick.
-
AuthorPosts
-
10-11-2018 at 14:06 #465901
Almachius
MemberHELLOW YANNICK….HIII PLUS ALL THE MEMBERS ON THIS FORUM…… AM CHRYSANTY FROM TANZANIA…..I FOLLOW UP YOUR TEACHINGS ON THIS FORUM AND SO MORE ON YOUR EXPERT ADVISOR PROGRAMMING….FROM YOUR TUTORIALS, I LEARNT A LOT THANKS SO MUCH PLEASE, AFTER FOLLOWING YOUR TUTORIALS, I CODED UP A SIMPLE EXPERT ADVISOR BASED ON A CUSTOM INDICATOR CALLED NONLAG ATTACHED BELOW THE CODE …BUT UNFORTUNATELY IT DIDNT WORK DESPITE THE FACT THAT I TRIED TO FIX IT UP FOLLOWING YOUR TUTORIALS,,,, PPLEASE BEG YOUR ASSISTANCE ON THIS…THANKS ALOT PLSE …..I WANT THE EXPERT TO ALERT ME BUY WHEN NONLAG IS BLUE AND TO SELL WHEN RED
SIMPLE EXPERT CODE HERE
extern int Price = 0;
extern int Length = 150;
extern int Displace = 0; //DispLace or Shift
extern double PctFilter = 0; //Dynamic filter in decimal
extern int Color = 1; //Switch of Color mode (1-color)
extern int ColorBarBack = 1; //Bar back for color mode
extern double Deviation = 0; //Up/down deviation
extern int AlertMode = 0; //Sound Alert switch (0-off,1-on)
extern int WarningMode = 0; //Sound Warning switch(0-off,1-on)
extern int Shift = 1;
int FastLen =0;//+——————————————————————+
//| Expert initialization function |
//+——————————————————————+
int OnInit()
{
//—//—
return(INIT_SUCCEEDED);
}
//+——————————————————————+
//| Expert deinitialization function |
//+——————————————————————+
void OnDeinit(const int reason)
{
//—}
//+——————————————————————+
//| Expert tick function |
//+——————————————————————+
void OnTick()
{
//—}
//+——————————————————————+
bool non()
{double nonlagy = iCustom(NULL, 0, “NonLagMA_v7.1”,Price,Length,Displace, PctFilter, Color, ColorBarBack, Deviation, AlertMode, WarningMode, 0,Shift);
//Buy: when current line is up and blue and previous line is down and red
//Sell: when current line is down and red and previous line is up and blue
double buy_macurrent = iCustom(NULL, 0, “NonLagMA_v7.1”,Price,FastLen,Displace, PctFilter, Color, ColorBarBack, Deviation, AlertMode, WarningMode, 1,Shift);double buy_maprevious = iCustom(NULL, 0, “NonLagMA_v7.1”,Price,FastLen,Displace, PctFilter, Color, ColorBarBack, Deviation, AlertMode, WarningMode, 1,Shift+1);
double sell_macurrent = iCustom(NULL, 0, “NonLagMA_v7.1”,Price,FastLen,Displace, PctFilter, Color, ColorBarBack, Deviation, AlertMode, WarningMode, 2,Shift);
double sell_maprevious = iCustom(NULL, 0, “NonLagMA_v7.1”,Price,FastLen,Displace, PctFilter, Color, ColorBarBack, Deviation, AlertMode, WarningMode, 2,Shift+1);
if (sell_maprevious!=EMPTY_VALUE && sell_macurrent==EMPTY_VALUE && buy_macurrent!=EMPTY_VALUE)//buy condition
{Alert(“TIME TO BUY”);
}
if(buy_maprevious!=EMPTY_VALUE && buy_macurrent==EMPTY_VALUE && sell_macurrent!=EMPTY_VALUE)//sell condition{
Alert(“TIME TO SELL”);
}
}10-11-2018 at 14:19 #465907 -
AuthorPosts
- You must be logged in to reply to this topic.