Rebellion Reverse 8 (KIV) (By ForexSeeker)

Gain : +20.9%
Drawdown 4.10%
Pips: 1402.3
Trades 72
Won:
Lost:
Type: Demo
Leverage: 1:500
Trading: Automated

Rebellion Reverse 8 (KIV) Discussion

Sep 16, 2010 at 11:42
662 Views
8 Replies
Member Since Apr 20, 2010   814 posts
Sep 16, 2010 at 11:59 (edited Sep 16, 2010 at 11:59)
This is actually my first creation of EA, while the SaveMe4 is the continue project of Salvation from by brother project.

The EA name is RebellionReverse-8, and you can imagine at lease 8 times have to look over the code and re-modify.

The main concept is still Martingale. Same as the Seeker Skyline, where it bet on one trend that might come.

An EA that base on indicator is always uncertainty as the oscillator indicator can not be right all the times. So it has an option to reverse the signal when the analysis always wrong.

I only do back test on EurUsd pair when coding the EA.
While in Demo test I just put all 4 main pair to see how the work out for the indicator.

Still in Beta test as not yet learn how to call indicator or icustom(), this is just base on build in indicator analysis.

Information is Gold when come to organised.
Member Since Oct 28, 2009   1424 posts
Sep 16, 2010 at 12:37
For icustom() just use the number against the colour of each component in the indicator property tab.
You also need to pass the settings for the indicator.
Here's an example

double IndicatorValue= iCustom(NULL, 0, 'Indicator', 10, 350, 1, 0);

Breaking it down ( currency, timeframe, indicator name, first indicator parameter, second indicator parameter, indicator buffer ( from the colour tab ), bar number )



11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
Member Since Apr 20, 2010   814 posts
Sep 17, 2010 at 03:18 (edited Sep 17, 2010 at 03:21)
17 Sep'10 : 9 hours no update.

How about the original indicator ? Do it need to modify or call the indicator first before start() ?

// Indicator ---- Cross EMA Arrow -------------

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

double g_ibuf_76[];
double g_ibuf_80[];
extern int FasterEMA = 4;
extern int SlowerEMA = 5;

int init() {
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0, 233);
   SetIndexBuffer(0, g_ibuf_76); //buy arrow
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, g_ibuf_80); //sell arrow
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   int li_8;
   double l_ima_12;
   double l_ima_20;
   double l_ima_28;
   double l_ima_36;
   double l_ima_44;
   double l_ima_52;
   double ld_60;
   double ld_68;
   int li_76 = IndicatorCounted();
   if (li_76 < 0) return (-1);
   if (li_76 > 0) li_76--;
   int li_0 = Bars - li_76;
   for (int li_4 = 0; li_4 <= li_0; li_4++) {
      li_8 = li_4;
      ld_60 = 0;
      ld_68 = 0;
      for (li_8 = li_4; li_8 <= li_4 + 9; li_8++) ld_68 += MathAbs(High[li_8] - Low[li_8]);
      ld_60 = ld_68 / 10.0;
      l_ima_12 = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, li_4);
      l_ima_28 = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, li_4 + 1);
      l_ima_44 = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, li_4 - 1);
      l_ima_20 = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, li_4);
      l_ima_36 = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, li_4 + 1);
      l_ima_52 = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, li_4 - 1);
      if (l_ima_12 > l_ima_20 && l_ima_28 < l_ima_36 && l_ima_44 > l_ima_52) g_ibuf_76[li_4] = Low[li_4] - ld_60 / 2.0;
      else
         if (l_ima_12 < l_ima_20 && l_ima_28 > l_ima_36 && l_ima_44 < l_ima_52) g_ibuf_80[li_4] = High[li_4] + ld_60 / 2.0;
   }
   return (0);
}

<a href='' target='_blank'><img src=''/></a>


So how I get the value of color out only ? Or the value1, and value2 ?

double EMACross0=iCustom(Symbol(),0,'EMA Crossover',10, 350, 1, 0);
double EMACross1=iCustom(Symbol(),0,'EMA Crossover',10, 350, 1, 1);
double EMACross2=iCustom(Symbol(),0,'EMA Crossover',10, 350, 1, 2);

My idea is when show red arrow, sell, when blue arrow buy.

if (EMACross0 == 0) order = Buy_Signal

I still don't understand how to get the iCustom work out to show which parameter i want.
And how to check back when is the previous arrow happened and on how many previous bar? As we want to avoid trade if the arrow show up to near each other..

Thanks for help.

Attachments:

Information is Gold when come to organised.
Member Since Oct 28, 2009   1424 posts
Sep 17, 2010 at 08:18
It would have to be an awkward one wouldn't it!
I'll download the indicator and take a look.

Are you using the modified MA at all ( red,blue line ) as you have to be careful the way you use this one. It doesn't accurately record the change over from red to blue and so you have to actually compare previous values on it if you are using it in iCustom()
11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
Member Since Oct 28, 2009   1424 posts
Sep 17, 2010 at 09:03 (edited Sep 17, 2010 at 09:05)
I haven't tested this but it's pretty much correct I think. Although I may not have defined all the variables I'm using and my counter might be out by one so you might have to adjust that. I called my custom indicator 'Cross EMA Arrow'. You may also wish to replace the variables used for the indicator by externals for optimising ( I used the defaults 4 and 5 )


//In variable declaration at the top
//Number of bars to wait after positive signal
extern int EMABars = 10;
//Bars count
double EMABuyCount = 0;
//Bars count
double EMASellCount = 0;
   
//In your start section
   //Checking for blue arrow on last bar
   double EMACrossBlue=iCustom(Symbol(),0,'Cross EMA Arrow',4, 5, 0, 1);
   //Checking for red arrow on last bar
   double EMACrossRed=iCustom(Symbol(),0,'Cross EMA Arrow',4, 5, 1, 1);
 
   // Set if blue arrow found
   if( EMACrossBlue != EMPTY_VALUE )
   {
      bool EMABuy = true ;
      EMABuyCount = EMABars;
   }
   // Set if red arrow found
   if( EMACrossRed != EMPTY_VALUE )
   {
      bool EMASell = true ;
      EMASellCount = EMABars;
   }
   
   if ( NewBar() == true)
   {
      if ( EMACrossBlue == EMPTY_VALUE ) EMABuyCount = EMABuyCount - 1;
      if ( EMACrossRed == EMPTY_VALUE ) EMASellCount = EMASellCount - 1;
   }
    
// In your order decision logic you need to add
if ( EMASell == True && EMASellCount < 0 ) Sell routine
if ( EMABuy == True && EMABuyCount < 0 ) Buy routine


//As a function at the end or beginning if that's where you place your functions
bool NewBar()
{
   static datetime lastbar = 0;
   datetime curbar = Time[0];
   if(lastbar!=curbar)
   {
      lastbar=curbar;
      return (true);
   }
   else
   {
      return(false);
   }
}
11:15, restate my assumptions: 1. Mathematics is the language of nature. 2. Everything around us can be represented and understood through numbers. 3. If you graph these numbers, patterns emerge. Therefore: There are patterns everywhere in nature.
Member Since Apr 20, 2010   814 posts
Sep 17, 2010 at 16:18
Thanks for the sample, it speed up my learning.

18 Sep;10 : Manually close UsdJpy after 2 days as the channel is very thin and break out not sure to which side.

<a href='' target='_blank'><img src=''/></a>

Take profit $2.53.

Attachments:

Information is Gold when come to organised.
Member Since Apr 20, 2010   814 posts
Sep 18, 2010 at 04:56
Revise lesson :

I see that most other value of indicator do output 2 data : Value 1 and Value 2.

So to get Value 1. Normally adjust on the buffer code ?

double EMACrossBlue=iCustom(Symbol(),0,'Cross EMA Arrow',4, 5, 0, 1);

double EMACrossBRed=iCustom(Symbol(),0,'Cross EMA Arrow',4, 5, 1, 1);

nt init() {
SetIndexStyle(0, DRAW_ARROW);
SetIndexArrow(0, 233);
SetIndexBuffer(0, g_ibuf_76); //buy arrow
SetIndexStyle(1, DRAW_ARROW);
SetIndexArrow(1, 234);
SetIndexBuffer(1, g_ibuf_80); //sell arrow
return (0);
}

If I want the EA code change instantly according the indicator attach, can it be done with this code? Or it just use the default value.

double EMACrossBlue=iCustom(Symbol(),0,'Cross EMA Arrow',FasterEMA , SlowerEMA , 0, 1);
double EMACrossBRed=iCustom(Symbol(),0,'Cross EMA Arrow',FasterEMA , SlowerEMA , 1, 1);

--------------------------------------
So the Return value of EMACrossBlue= g_ibuf_76 ; EMACrossBRed=g_ibuf_80 ??



Information is Gold when come to organised.
Member Since Apr 20, 2010   814 posts
Sep 29, 2010 at 01:31 (edited Sep 29, 2010 at 01:32)
29 Sep'10 : Restart platform to reset the martingale logic, so all will start from 0.01 again. Gain back to track but as playing with 4 pair, each pair will have their own martingale memory and sometimes overlap.
Information is Gold when come to organised.
Member Since Apr 20, 2010   814 posts
Oct 15, 2010 at 03:56
The Back Test only show it can pass on 30 minute, 60 minute fail. Yet my demo forward test is on 60 minute.
I totally have no idea why I want to put 1 hour chart on first times. Instinct disorder instead of logic define.

<a href='' target='_blank'><img src=''/></a>

Attachments:

Information is Gold when come to organised.
Sign In / Sign Up to comment
You must be connected to Myfxbook in order to leave a comment
*Commercial use and spam will not be tolerated, and may result in account termination.
Tip: Posting an image/youtube url will automatically embed it in your post!
Tip: Type the @ sign to auto complete a username participating in this discussion.