molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Sat May 11, 2024 11:05 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Help to build this lucrative strategy
PostPosted: Wed Nov 28, 2012 3:47 pm 
Offline

Joined: Tue Nov 22, 2011 3:28 pm
Posts: 83
How do I make it work perfectly this strategy that this image? Tried everything, in various ways, and even then continues opening few or almost no orders.

Image

I'm using:
"Bollinger Bands" to set 20 Deviations period 2
"Stochastic Oscillator" set to% K 9 period; %D 3 period and Slowing 3

Please find attached the file. initial analysis mol! I count on help with Molanis team and to all the community forum!

It is an excellent strategy!

Rules ... The previous candle have to at least touch on the lines from above or from below.

To buy, the previous candle have to pull over in the lower row of Boliger and cross below from up the level 20.

To sell, the previous candle have to pull over at the top of Boliger, and cruising up from down the level 80.

I'm sorry English is not my native language.


Attachments:
PB2.jpg
PB2.jpg [ 175.57 KiB | Viewed 6081 times ]
TCFPowerBand EA 1.1.mol [24.23 KiB]
Downloaded 483 times
Top
 Profile  
 
 Post subject: Re: Help to build this lucrative strategy
PostPosted: Thu Nov 29, 2012 5:23 pm 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
I will try to help you out. Note: I will be working with mq4 files in MetaEditor, so you will no longer be able to edit the mol in Molanis. This will take some time.

_________________
I'm not a programmer, but I play one on TV.


Top
 Profile  
 
 Post subject: Re: Help to build this lucrative strategy
PostPosted: Thu Nov 29, 2012 11:04 pm 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
Ok, so not too much time. :ugeek:

Edit: See below for EA

_________________
I'm not a programmer, but I play one on TV.


Last edited by RJo on Fri Nov 30, 2012 2:30 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Help to build this lucrative strategy
PostPosted: Fri Nov 30, 2012 8:54 am 
Offline

Joined: Tue Nov 22, 2011 3:28 pm
Posts: 83
Thanks RJo by time made available for helping me in this EA!

I'm in tests here.

What changes have you made for my version of EA?


Top
 Profile  
 
 Post subject: Re: Help to build this lucrative strategy
PostPosted: Fri Nov 30, 2012 10:02 am 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
tcanuto wrote:
Thanks RJo by time made available for helping me in this EA!

I'm in tests here.

What changes have you made for my version of EA?


You:
Code:
//+------------------------------------------------------------------+
//| MT Variables Created by User                                     |
/*| */
//+------------------------------------------------------------------+


Me:
Code:
//+------------------------------------------------------------------+
//| MT Variables Created by User                                     |
/*| */
//+------------------------------------------------------------------+
int BollCross;


You:
Code:
// Trading code starts here
if (TradeOrAlert) {
// Check conditions
if (  ( MarketInfo(Symbol(),MODE_BID)  <  5.00000 )
   && ( MarketInfo(Symbol(),MODE_BID)  <  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,0) ) )
   {  CLOSESHORT(Symbol()) ;}
if (  ( MarketInfo(Symbol(),MODE_ASK)  >  5.00000 )
   && ( MarketInfo(Symbol(),MODE_ASK)  >  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,0) ) )
   {  CLOSELONG(Symbol()) ;}
if (  ( MarketInfo(Symbol(),MODE_BID)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,1) )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,1)  >=  80.00000 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,0)  <  80.00000 )
   && ( MarketInfo(Symbol(),MODE_BID)  <  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,0) )
   && ( iOpen(Symbol(),0,0)  <  iHigh(Symbol(),0,1) ) )
   {  SELL(Symbol(),S_Symbol_LS_0,S_Symbol_TP_0,S_Symbol_SL_0,S_Symbol_TS_0,"if (  ( MarketInfo(Symbol(),MODE_BID)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,1) ) A...") ;}
if (  ( MarketInfo(Symbol(),MODE_ASK)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,1) )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,1)  <=  20.00000 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,0)  >  20.00000 )
   && ( MarketInfo(Symbol(),MODE_ASK)  >  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,0) )
   && ( iOpen(Symbol(),0,0)  >  iLow(Symbol(),0,1) ) )
   {  BUY(Symbol(),B_Symbol_LS_0,B_Symbol_TP_0,B_Symbol_SL_0,B_Symbol_TS_0,"if (  ( MarketInfo(Symbol(),MODE_ASK)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,1) ) A...") ;}

   
// Check Trailing stops
CheckTrailingStop(Symbol(),OP_SELL,MagicNumberShort,S_Symbol_TS_0);
CheckTrailingStop(Symbol(),OP_BUY,MagicNumberLong,B_Symbol_TS_0);

} else {
// Alerts
if (  ( MarketInfo(Symbol(),MODE_BID)  <  5.00000 )
   && ( MarketInfo(Symbol(),MODE_BID)  <  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,0) ) )
   { MolanisAlert("if (  ( MarketInfo(Symbol(),MODE_BID)  <  5.00000 ) && ( MarketInfo(Symbol(),MODE_BID)  <  iBands(...","CLOSESHORT(Symbol())",Symbol()) ;}
if (  ( MarketInfo(Symbol(),MODE_ASK)  >  5.00000 )
   && ( MarketInfo(Symbol(),MODE_ASK)  >  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,0) ) )
   { MolanisAlert("if (  ( MarketInfo(Symbol(),MODE_ASK)  >  5.00000 ) && ( MarketInfo(Symbol(),MODE_ASK)  >  iBands(...","CLOSELONG(Symbol())",Symbol()) ;}
if (  ( MarketInfo(Symbol(),MODE_BID)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,1) )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,1)  >=  80.00000 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,0)  <  80.00000 )
   && ( MarketInfo(Symbol(),MODE_BID)  <  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,0) )
   && ( iOpen(Symbol(),0,0)  <  iHigh(Symbol(),0,1) ) )
   { MolanisAlert("if (  ( MarketInfo(Symbol(),MODE_BID)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,1) ) AND...","SELL(Symbol(),0.01,0,0,25)",Symbol()) ;}
if (  ( MarketInfo(Symbol(),MODE_ASK)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,1) )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,1)  <=  20.00000 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,0)  >  20.00000 )
   && ( MarketInfo(Symbol(),MODE_ASK)  >  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,0) )
   && ( iOpen(Symbol(),0,0)  >  iLow(Symbol(),0,1) ) )
   { MolanisAlert("if (  ( MarketInfo(Symbol(),MODE_ASK)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,1) ) AND...","BUY(Symbol(),0.01,0,0,25)",Symbol()) ;}

}//trading code ends here


Me:
Code:
// Trading code starts here
if (TradeOrAlert) {
// Check conditions
if ( ( MarketInfo(Symbol(),MODE_BID)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,0) ) )
   {  CLOSESHORT(Symbol()) ;}
if ( ( MarketInfo(Symbol(),MODE_BID)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,0) ) )
   {  CLOSELONG(Symbol()) ;}
if (  ( iClose(Symbol(),0,1)  <  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,1) )
   && ( iHigh(Symbol(),0,1)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,1) ) )
   {  BollCross = 2 ;}
if (  ( BollCross == 2 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,2)  >=  80.00000 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,1)  <  80.00000 ) )
   {  SELL(Symbol(),S_Symbol_LS_0,S_Symbol_TP_0,S_Symbol_SL_0,S_Symbol_TS_0,"if (  ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,2)  >=  80.00000 ) && ( iStochastic(Sy...") ;
      BollCross = 0 ;}
if (  ( iClose(Symbol(),0,1)  >  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,1) )
   && ( iLow(Symbol(),0,1)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,1) ) )
   {  BollCross = 1 ;}
if (  ( BollCross == 1 )   
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,2)  <=  20.00000 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,1)  >  20.00000 ) )
   {  BUY(Symbol(),B_Symbol_LS_0,B_Symbol_TP_0,B_Symbol_SL_0,B_Symbol_TS_0,"if (  ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,2)  <=  20.00000 ) && ( iStochastic(Sy...") ;
      BollCross = 0 ;}

   
// Check Trailing stops
CheckTrailingStop(Symbol(),OP_SELL,MagicNumberShort,S_Symbol_TS_0);
CheckTrailingStop(Symbol(),OP_BUY,MagicNumberLong,B_Symbol_TS_0);

} else {
// Alerts
if ( ( MarketInfo(Symbol(),MODE_BID)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,0) ) )
   { MolanisAlert("if ( ( MarketInfo(Symbol(),MODE_BID)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,0) ) )","CLOSESHORT(Symbol())",Symbol()) ;}
if ( ( MarketInfo(Symbol(),MODE_BID)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,0) ) )
   { MolanisAlert("if ( ( MarketInfo(Symbol(),MODE_BID)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,0) ) )","CLOSELONG(Symbol())",Symbol()) ;}
if (  ( iClose(Symbol(),0,1)  <  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,1) )
   && ( iHigh(Symbol(),0,1)  >=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_UPPER,1) ) )
   {  BollCross = 2 ;}
if (  ( BollCross == 2 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,2)  >=  80.00000 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,1)  <  80.00000 ) ) 
   { MolanisAlert("if (  ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,2)  >=  80.00000 ) && ( iStochastic(Symb...","SELL(Symbol(),0.01,0,0,25)",Symbol()) ;
     BollCross = 0 ;}
if (  ( iClose(Symbol(),0,1)  >  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,1) )
   && ( iLow(Symbol(),0,1)  <=  iBands(Symbol(),0,20,2,0,PRICE_CLOSE,MODE_LOWER,1) ) )
   {  BollCross = 1 ;}
if (  ( BollCross == 1 )   
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,2)  <=  20.00000 )
   && ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,1)  >  20.00000 ) )
   { MolanisAlert("if (  ( iStochastic(Symbol(),0,9,3,3,MODE_SMA,0,MODE_MAIN,2)  <=  20.00000 ) && ( iStochastic(Symb...","BUY(Symbol(),0.01,0,0,25)",Symbol()) ;
     BollCross = 0 ;}

}//trading code ends here


This reminded me... I did not send you the Alert code, so here it is. Resave over the EA I sent earlier.


Attachments:
TCFPowerBand EA 1.2.mq4 [90.68 KiB]
Downloaded 484 times

_________________
I'm not a programmer, but I play one on TV.
Top
 Profile  
 
 Post subject: Re: Help to build this lucrative strategy
PostPosted: Fri Nov 30, 2012 1:26 pm 
Offline

Joined: Tue Nov 22, 2011 3:28 pm
Posts: 83
Ok RJo. I wanted to say in words, not in the code you did differently. Open the code but it's great and not be able to do what I asked. Please if you can send me the code already with these changes, because it pops up 5 lines of warnings do not know why.

Once again thank you! I am doing a full test with 99% modeling optimization with to see if it really is profitable this system.

Even more.


Top
 Profile  
 
 Post subject: Re: Help to build this lucrative strategy
PostPosted: Fri Nov 30, 2012 2:28 pm 
Offline

Joined: Sun Jun 19, 2011 9:38 pm
Posts: 270
Don't worry about the "warnings" in MetaEditor that appear when you compile. It's telling you that there are 5 unused Molanis functions that it's removing. This is what it's supposed to do.

My last post is the code with the changes. That's where I copied from. I'll stay tuned for your test results.

_________________
I'm not a programmer, but I play one on TV.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009