• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 9:50am
  • Search
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 9:50am
Search
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Search

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Gold Miner - Gold future support and resistance level trade 7 replies

Reliable mt4 support and resistance level weekly and monthly 0 replies

Support & Resistance Level (help needed) 6 replies

How recognize false and right breakout of support or resistance level. 5 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

support and resistance level for EA

  • Post #1
  • Quote
  • First Post: Aug 26, 2019 2:10am Aug 26, 2019 2:10am
  •  munna00
  • Joined Feb 2018 | Status: Member | 75 Posts
my code giving error during EA run, " array out of control and critical error in EA in journal "

Inserted Code
   int shift = 0;
double res = 0;
double sup = 0;
 
for(shift=Bars-1;shift>=0 ;shift--){
 
if( Close[shift+2]>= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+2)&&
 Close[shift+1]< iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+1))
res=High[Highest(NULL, 0, MODE_HIGH,shift+20,20)];
 
if( Close[shift+2]<= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+2)&&
Close[shift+1]> iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+1))
sup=Low[Lowest(NULL, 0, MODE_LOW,shift+20,20)];
 
}
  • Post #2
  • Quote
  • Aug 26, 2019 2:39am Aug 26, 2019 2:39am
  •  FerruFx
  • Joined May 2007 | Status: MT4/MT5 EAs/Indicators/Alerts coder | 6,633 Posts
Quoting munna00
Disliked
my code giving error during EA run, " array out of control and critical error in EA in journal " int shift = 0; double res = 0; double sup = 0; for(shift=Bars-1;shift>=0 ;shift--){ if( Close[shift+2]>= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+2)&& Close[shift+1]< iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+1)) res=High[Highest(NULL, 0, MODE_HIGH,shift+20,20)]; if( Close[shift+2]<= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+2)&& Close[shift+1]> iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+1)) sup=Low[Lowest(NULL, 0, MODE_LOW,shift+20,20)];...
Ignored
You start the loop at Bars-1 ... while you are checking value for shift+20 ... so before the first bar in history ...
MT4/MT5 EAs/Indicators/Alerts coder
  • Post #3
  • Quote
  • Last Post: Aug 26, 2019 2:53am Aug 26, 2019 2:53am
  •  MathTrader7
  • Joined Aug 2014 | Status: Trading | 1,929 Posts | Invisible
Quoting munna00
Disliked
my code giving error during EA run, " array out of control and critical error in EA in journal " int shift = 0; double res = 0; double sup = 0; for(shift=Bars-1;shift>=0 ;shift--){ if( Close[shift+2]>= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+2)&& Close[shift+1]< iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+1)) res=High[Highest(NULL, 0, MODE_HIGH,shift+20,20)]; if( Close[shift+2]<= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+2)&& Close[shift+1]> iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+1)) sup=Low[Lowest(NULL, 0, MODE_LOW,shift+20,20)];...
Ignored
Start from Bars-21
"Life is what happens when you're busy making other plans." -John Lennon
1
Thread Tools Search this Thread
Show Printable Version Show Printable Version
Email This Thread Email This Thread
Search this Thread:

Advanced Search

  • Platform Tech
  • /
  • support and resistance level for EA
  • 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 / ©2019