Forex Factory
  • Home
  • Forums
  • News
  • Market
  • Login
  • User/Email: Password:
  • 8:38pm
  • Search
Menu
  • Forums
  • News
  • Market
  • Login
  • 8:38pm
Search

Options

Search

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

You are viewing
the Crypto Craft
beta version.

Your participation
is appreciated!

Similar Threads

Price Pattern Notifications/Trend Alert Price Action Scanner 7 replies

Fibonacci levels alert indicator needed with push notifications 21 replies

What indicators do Hedge Funds use or do they even use one? 12 replies

Alerts & Notifications 10 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

Unable To Use 2 Notifications At One Time

  • Post #1
  • Quote
  • First Post: Jul 31, 2018 9:40pm Jul 31, 2018 9:40pm
  •  SLaKerZ
  • | Joined Apr 2013 | Status: Member | 66 Posts
Hi,

I have done with my code and all working fine... Now i'm trying to add code but somehow having problem.. Here's the problem,

If i Set true for *HANDPHONE NOTIFICATION" ONLY, i will get the Alert at My Mobile
BUT
If i Set true for *HANDPHONE NOTIFICATION" AND "POPUP NOTIFICATION", I will never get any Alert for Mobile Or even the Popup Alert

Here's my Code

Inserted Code
input bool NOTIFICATION = false;//HANDPHONE NOTIFICATION
input bool POPUP = false;//POPUP NOTIFICATION

Inserted Code
datetime TIME=0;

Inserted Code
      if(
         iMA(_Symbol,PERIOD_M15,50,0,MODE_EMA,PRICE_CLOSE,iBarShift(_Symbol,PERIOD_M15,Time[i]))>iMA(_Symbol,PERIOD_M15,100,0,MODE_EMA,PRICE_CLOSE,iBarShift(_Symbol,PERIOD_M15,Time[i])) &&
         iMA(_Symbol,PERIOD_M15,100,0,MODE_EMA,PRICE_CLOSE,iBarShift(_Symbol,PERIOD_M15,Time[i]))>iMA(_Symbol,PERIOD_M15,200,0,MODE_EMA,PRICE_CLOSE,iBarShift(_Symbol,PERIOD_M15,Time[i])) &&
         iMACD(_Symbol,PERIOD_M15,12,26,1,PRICE_CLOSE,MODE_MAIN,iBarShift(_Symbol,PERIOD_M15,Time[i]))>0.0 &&
         iStochastic(_Symbol,PERIOD_M15,3,1,3,MODE_EMA,(int)sto_price,MODE_MAIN,iBarShift(_Symbol,PERIOD_M15,Time[i]))<sto_dn_levelM15 &&
         iStochastic(_Symbol,PERIOD_M15,3,1,3,MODE_EMA,(int)sto_price,MODE_SIGNAL,iBarShift(_Symbol,PERIOD_M15,Time[i]))<sto_dn_levelM15 &&
         iStochastic(_Symbol,PERIOD_M1,3,1,3,MODE_EMA,(int)sto_price,MODE_MAIN,i)<sto_dn_levelM1 &&
         iStochastic(_Symbol,PERIOD_M1,3,1,3,MODE_EMA,(int)sto_price,MODE_SIGNAL,i)<sto_dn_levelM1
         )
        {if(NOTIFICATION){
         SendNotification(Symbol() + " " + " " + "BUY" + " " + "DATE :" + " " + TimeToStr(TimeLocal(),TIME_DATE) + " " + "TIME :" + " " + TimeToStr(TimeLocal(),TIME_MINUTES));
         }
         if(POPUP){
         Alert(Symbol() + " " + " " + "SELL" + " " + "DATE :" + " " + TimeToStr(TimeLocal(),TIME_DATE) + " " + "TIME :" + " " + TimeToStr(TimeLocal(),TIME_MINUTES));
         }
         TIME=Time[0];
        }
  • Post #2
  • Quote
  • Last Post: Aug 1, 2018 2:00pm Aug 1, 2018 2:00pm
  •  Nicholishen
  • Joined Jul 2005 | Status: zzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzz | 1,223 Posts
You probably have an issue in a section of code that you aren't posting. I would recommend that you have a look at some c++ style guides because your code is hard to read, and because of the odd way you are using braces and indentation you'll eventually fool yourself into making nesting errors, that would otherwise be obviously visible once you refactor your code. Here's an example of your code refactored to make it more readable.

Inserted Code
void OnTick()
{
   bool ma1 = iMA(_Symbol,PERIOD_M15,50,0,MODE_EMA,PRICE_CLOSE,iBarShift(_Symbol,PERIOD_M15,Time[i])) > iMA(_Symbol,PERIOD_M15,100,0,MODE_EMA,PRICE_CLOSE,iBarShift(_Symbol,PERIOD_M15,Time[i]));
   bool ma2 = iMA(_Symbol,PERIOD_M15,100,0,MODE_EMA,PRICE_CLOSE,iBarShift(_Symbol,PERIOD_M15,Time[i])) > iMA(_Symbol,PERIOD_M15,200,0,MODE_EMA,PRICE_CLOSE,iBarShift(_Symbol,PERIOD_M15,Time[i]));
   bool macd = iMACD(_Symbol,PERIOD_M15,12,26,1,PRICE_CLOSE,MODE_MAIN,iBarShift(_Symbol,PERIOD_M15,Time[i])) > 0.0;
   bool sto1 = iStochastic(_Symbol,PERIOD_M15,3,1,3,MODE_EMA,(int)sto_price,MODE_MAIN,iBarShift(_Symbol,PERIOD_M15,Time[i])) < sto_dn_levelM15;
   bool sto2 = iStochastic(_Symbol,PERIOD_M15,3,1,3,MODE_EMA,(int)sto_price,MODE_SIGNAL,iBarShift(_Symbol,PERIOD_M15,Time[i])) < sto_dn_levelM15;
   bool sto3 = iStochastic(_Symbol,PERIOD_M1,3,1,3,MODE_EMA,(int)sto_price,MODE_MAIN,i) < sto_dn_levelM1;
   bool sto4 = iStochastic(_Symbol,PERIOD_M1,3,1,3,MODE_EMA,(int)sto_price,MODE_SIGNAL,i) < sto_dn_levelM1;
   if(ma1 && ma2 && macd && sto1 && sto2 && sto3 && sto4)
   {
      string alert=StringFormat("%s BUY DATE: %s",_Symbol,TimeToString(TimeLocal(),TIME_DATE|TIME_MINUTES));
      if(inpPush)
         SendNotification(alert);
      if(inpAlert)
         Alert(alert);
      last_time = Time[0];
   }
}
Thread Tools Search this Thread
Show Printable Version Show Printable Version
Email This Thread Email This Thread
Search this Thread:

Advanced Search

  • Platform Tech
  • /
  • Unable To Use 2 Notifications At One Time
  • Reply to Thread
0 traders viewing now
Top of Page

You are viewing
the Crypto Craft
beta version.

Your participation
is appreciated!

You are viewing
the Crypto Craft
beta version.

Your participation
is appreciated!

  • Facebook
  • Twitter
CC Website
  • Homepage
  • Search
  • Members
  • User Guide
  • Report a Bug
CC Products
  • Forums
  • News
  • Market
About CC
  • Mission
  • Products
  • Blog
  • Contact
Follow CC
  • Facebook
  • Twitter

Other Markets:

  • Forex Factory
  • Energy EXCH
  • Metals Mine

Crypto Craft™ is a brand of Fair Economy, Inc.

Terms of Service / ©2019