• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 6:53pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 6:53pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

stop loss function and edit time function for Breakout EA 1 reply

trading system help required 18 replies

Problem with Function + its call 1 reply

MT4 external exec call function ? 5 replies

Backtesting Data required... where!? 5 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 1
Attachments: required to function call function
Exit Attachments
Tags: required to function call function
Cancel

required to function call function

  • Post #1
  • Quote
  • First Post: Edited 6:46am Apr 21, 2018 6:35am | Edited 6:46am
  •  munna00
  • Joined Feb 2018 | Status: Member | 112 Posts
i need little help in function call in another function

Inserted Code
 
int filter() {
double aaa = Bid;
 
//-------------------------------------------------- Daily ----------------------
 wclose= iClose(Symbol(),PERIOD_D1,1);
      wopen = iClose(Symbol(),PERIOD_D1,1);
      whigh = iHigh(Symbol(),PERIOD_D1,1);
      wlow=iLow(Symbol(),PERIOD_D1,1);
    
  calPivot = (whigh+wlow+wclose)/3;
  
   calRange=(whigh-wlow);
 
      R38  = calRange*0.382+calPivot;
      R61  = calRange*0.618+calPivot;
      R78  = calRange*0.786+calPivot;
  
      S38  = calPivot-calRange*0.382;
      S61  = calPivot-calRange*0.618;
      S78  = calPivot-calRange*0.786;
  
//-------------------------------------------------- Weekly ----------------------
     wclose1= iClose(Symbol(),PERIOD_W1,1);
      wopen1 = iClose(Symbol(),PERIOD_W1,1);
      whigh1 = iHigh(Symbol(),PERIOD_W1,1);
      wlow1=iLow(Symbol(),PERIOD_W1,1);
    
  calPivot1 = (whigh1+wlow1+wclose1)/3;
  
   calRange1=(whigh1-wlow1);
      RR38  = calRange1*0.382+calPivot1;
      RR61  = calRange1*0.618+calPivot1;
      RR78  = calRange1*0.786+calPivot1;
  
      SS38  = calPivot1-calRange1*0.382;
      SS61  = calPivot1-calRange1*0.618;
      SS78  = calPivot1-calRange1*0.786;
      
//------------------------------------------------------------------------
 
      if ((aaa > R78 ) || (aaa > RR38)){
      int buy = 1;
      return(buy);
      }
    
      if ((aaa < S78 ) || (aaa < SS38)){
     int sell = 1;
     return(sell);
      }
    
  return(0);
}
 
void open_sell()
{
int xxx = filter();
if (xxx < 1){
 
Order send----------------------------
 
}
}
void open_buy()
{
int xxx = filter();
if (xxx < 1){
 
Order send----------------------------
 
}
}

are my call function here is ok? but its not working
  • Post #2
  • Quote
  • Apr 22, 2018 12:30am Apr 22, 2018 12:30am
  •  munna00
  • Joined Feb 2018 | Status: Member | 112 Posts
can anybody help me regarding call and compare others function output, please
 
 
  • Post #3
  • Quote
  • Last Post: Apr 22, 2018 1:36pm Apr 22, 2018 1:36pm
  •  hayseed
  • Joined Nov 2006 | Status: Member | 3,818 Posts
Quoting munna00
Disliked
are my call function here is ok? but its not working
Ignored
//-----

hey munna...... be sure to think deep before using any code to send orders in a live account...... and never use anything that places trades if you cant see the mq4......h

//-----
Inserted Code
int start()
  {
  
  if(filter() == 0) Alert(Symbol()+"  bid > dayres38 send buy");
  if(filter() == 1) Alert(Symbol()+"  bid < dayres38 send sell");
  
  return(0);
  }
 

 
 int filter()
  {
      double bid       = MarketInfo(Symbol(),MODE_BID);
      int    signal    = -1;
      
//---
//---              day
 
 
      double dayclose  = iClose(Symbol(),PERIOD_D1,1);
      double dayopen   = iClose(Symbol(),PERIOD_D1,1);
      double dayhigh   = iHigh(Symbol(),PERIOD_D1,1);
      double daylow    = iLow(Symbol(),PERIOD_D1,1);
    
      double daypivot  = (dayhigh+daylow+dayclose)/3;
  
      double dayrange  = (dayhigh-daylow);
 
      double dayres38  = (dayrange*0.382)+daypivot;
      double dayres61  = (dayrange*0.618)+daypivot;
      double dayres78  = (dayrange*0.786)+daypivot;
  
      double daysup38  = daypivot-(dayrange*0.382);
      double daysup61  = daypivot-(dayrange*0.618);
      double daysup78  = daypivot-(dayrange*0.786);
  
//---
//---              week

      double weekclose = iClose(Symbol(),PERIOD_W1,1);
      double weekopen  = iClose(Symbol(),PERIOD_W1,1);
      double weekhigh  = iHigh(Symbol(),PERIOD_W1,1);
      double weeklow   = iLow(Symbol(),PERIOD_W1,1);
    
      double weekpivot = (weekhigh+weeklow+weekclose)/3;
  
      double weekrange = (weekhigh-weeklow);
 
      double weekres38 = (weekrange*0.382)+weekpivot;
      double weekres61 = (weekrange*0.618)+weekpivot;
      double weekres78 = (weekrange*0.786)+weekpivot;
  
      double weeksup38 = weekpivot-(weekrange*0.382);
      double weeksup61 = weekpivot-(weekrange*0.618);
      double weeksup78 = weekpivot-(weekrange*0.786);
      
//------------------------------------------------------------------------
 
      if((bid > dayres78 ) || (bid > dayres38))
      {
      signal = 0;
      }
    
      if((bid < daysup78 ) || (bid < daysup38))
      {
      signal = 1;
      }
    
  return(signal);
}

//-----
Attached File(s)
File Type: mq4 munna.mq4   3 KB | 309 downloads
to trade and code, keep both simple... no call to impress....h
 
 
  • Platform Tech
  • /
  • required to function call function
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023