Jump to content

Cowabunga system indicator and EA


Recommended Posts

  • 2 months later...

Re: [req] cowabunga

 

To all who search the cowabunga, here is the indicators:

http://www.4shared.com/file/254858807/37cc4308/Cowabunga.html

 

The rules:

http://www.4shared.com/file/254861105/ecbb2cf1/cowabunga.html

Edited by sgr
Link to comment
Share on other sites

Re: Cowabunga system indicator and EA

 

the ea from funyoo doesnt match the trading style really. it has to be recoded.

i dont even know if the indicator is working like it should, anyway.

its a really nice system. GBP/USD M15 for entrys and H4 for trends.

Link to comment
Share on other sites

Re: Cowabunga system indicator and EA

 

yep dear funyoo make a good system but not the "real" cowabunga, i alredy maked an "improved" version, its called "Rsi Power Maximum" (you can google it, free) i deleted useless logics from cowabunga end this is the result.. and fxgtc sell this one for 200$ X_X they rename to saturn X_X you can too googling for this informations or search "saturn" in funyoo site

 

my name is Denoiser on he's forum :)

 

Regards

Link to comment
Share on other sites

Re: Cowabunga system indicator and EA

 

i tried to code it myself but its really hard, i have some experience within other languages but not in mt4. the strategy is pretty complicated and you always should be aware of news events. anyway it was the first strategy worth looking deeper into it because its a great manual system which made me a lot of pips on my micro account, but i really dont want to stick to charts all day waiting for those conditions to appear. even if i'd have the time to do it i wouldnt. :)

one fault funyoo has done e.g. is calling wrong indicator for macd instead of iosma to get the correct macd value.

 

i will search for rsi power maximum. thank you enforcer.

Link to comment
Share on other sites

Re: Cowabunga system indicator and EA

 

#define EAName "Cowabunga System EA"

 

extern string S1a="---------------- H4 TF Settings";

extern int MainTimeFrame=240;

extern int FEMAPeriod1=5;

extern int SEMAPeriod1=10;

extern int RSIPeriod1=9;

extern int RSIBuyLevel1=50;

extern int RSISellLevel1=50;

extern int StochKP1=10;

extern int StochDP1=3;

extern int StochSP1=3;

extern string S1b="---------------- M15 TF Settings";

extern int SignalTimeFrame=15;

extern int FEMAPeriod2=5;

extern int SEMAPeriod2=10;

extern int RSIPeriod2=9;

extern int RSIBuyLevel2=50;

extern int RSISellLevel2=50;

extern int StochKP2=10;

extern int StochDP2=3;

extern int StochSP2=3;

extern int OverboughtZone=80;

extern int OversoldZone=20;

extern int MACDFast2=12;

extern int MACDSlow2=26;

extern int MACDSMA2=9;

extern int MACDBuyLevel2=0;

extern int MACDSellLevel2=0;

extern string S2="---------------- Money Management";

extern double Lots=0.1; //lots

extern bool RiskManagement=false; //money management

extern double RiskPercent=10; //risk in percentage

extern string S3="---------------- Order Management";

extern int StopLoss=0; //stop loss

extern int TakeProfit=0; //take profit

extern int TrailingStop=0; //trailing stop

int TrailingStep=1; //margin allowe to the price before to enable the ts

extern int BreakEven=0; //breakeven

extern bool AddPositions=false; //positions cumulated

extern int MaxOrders=100; //maximum number of orders

extern int Slippage=3;

extern int Magic=0; // magic number

extern string S5="---------------- Extras";

extern bool ReverseTheSystem=false; //sell/buy instead of buy/sell

 

int err=0;int TK;double Balance=0.0;double maxEquity;double minEquity;int result;

 

//start function

int start(){int SL=StopLoss;int TP=TakeProfit;int TK=0;int j=0,limit=1;double SLI=0,TPI=0;double BV=0,SV=0;

for(int i=1;i<=limit;i++){

 

 

//main signal

double SEMH4=iMA(Symbol(),MainTimeFrame,FEMAPeriod1,0,MODE_EMA,PRICE_CLOSE,i);

double FEMH4=iMA(Symbol(),MainTimeFrame,SEMAPeriod1,0,MODE_EMA,PRICE_CLOSE,i);

double RSIH4=iRSI(NULL,MainTimeFrame,RSIPeriod1,PRICE_CLOSE,i);

double STMH4a=iStochastic(NULL,MainTimeFrame,StochKP1,StochDP1,StochSP1,MODE_SMA,0,MODE_MAIN,i+1);

double STSH4a=iStochastic(NULL,MainTimeFrame,StochKP1,StochDP1,StochSP1,MODE_SMA,0,MODE_SIGNAL,i+1);

double STMH4=iStochastic(NULL,MainTimeFrame,StochKP1,StochDP1,StochSP1,MODE_SMA,0,MODE_MAIN,i);

double STSH4=iStochastic(NULL,MainTimeFrame,StochKP1,StochDP1,StochSP1,MODE_SMA,0,MODE_SIGNAL,i);

 

double SEMM15a=iMA(Symbol(),SignalTimeFrame,FEMAPeriod2,0,MODE_EMA,PRICE_CLOSE,i+1);

double FEMM15a=iMA(Symbol(),SignalTimeFrame,SEMAPeriod2,0,MODE_EMA,PRICE_CLOSE,i+1);

double SEMM15=iMA(Symbol(),SignalTimeFrame,FEMAPeriod2,0,MODE_EMA,PRICE_CLOSE,i);

double FEMM15=iMA(Symbol(),SignalTimeFrame,SEMAPeriod2,0,MODE_EMA,PRICE_CLOSE,i);

double RSIM15=iRSI(NULL,SignalTimeFrame,RSIPeriod2,PRICE_CLOSE,i);

double STMM15a=iStochastic(NULL,SignalTimeFrame,StochKP2,StochDP2,StochSP2,MODE_SMA,0,MODE_MAIN,i+1);

double STSM15a=iStochastic(NULL,SignalTimeFrame,StochKP2,StochDP2,StochSP2,MODE_SMA,0,MODE_SIGNAL,i+1);

double STMM15=iStochastic(NULL,SignalTimeFrame,StochKP2,StochDP2,StochSP2,MODE_SMA,0,MODE_MAIN,i);

double STSM15=iStochastic(NULL,SignalTimeFrame,StochKP2,StochDP2,StochSP2,MODE_SMA,0,MODE_SIGNAL,i);

double MACM15=iMACD(NULL,SignalTimeFrame,MACDFast2,MACDSlow2,MACDSMA2,PRICE_CLOSE,MODE_MAIN,0);

 

string BUY="false";string SELL="false";

if(

(FEMM15a<SEMM15a&&FEMM15>SEMM15&&RSIM15>RSIBuyLevel2&&STMM15>STMM15a&&STSM15>STSM15a&&STMM15<OverboughtZone&&STSM15<OverboughtZone&&MACM15>MACDBuyLevel2)&&

(SEMH4>FEMH4&&RSIH4>RSIBuyLevel1&&STMH4>STMH4a&&STSH4>STSH4a)

)BUY="true";

if(

(FEMM15a>SEMM15a&&FEMM15<SEMM15&&RSIM15<RSISellLevel2&&STMM15<STMM15a&&STSM15<STSM15a&&STMM15>OversoldZone&&STSM15>OversoldZone&&MACM15<MACDSellLevel2)&&

(SEMH4<FEMH4&&RSIH4<RSISellLevel1&&STMH4<STMH4a&&STSH4<STSH4a)

 

)SELL="true";

 

//entry conditions

if(

//MAFIB=="true"&&

BUY=="true"){if(ReverseTheSystem)SV=1;else BV=1;break;}

if(

//MAFIS=="true"&&

SELL=="true"){if(ReverseTheSystem)BV=1;else SV=1;break;}}

 

//risk management

bool MM=RiskManagement;

if(MM){if(RiskPercent<0.1||RiskPercent>100){Comment("Invalid Risk Value.");return(0);}

else{Lots=MathFloor((AccountFreeMargin()*AccountLeverage()*RiskPercent*Point*100)/(Ask*MarketInfo(Symbol(),MODE_LOTSIZE)*

MarketInfo(Symbol(),MODE_MINLOT)))*MarketInfo(Symbol(),MODE_MINLOT);}}

if(MM==false){Lots=Lots;}

 

 

 

int cnt=0,OP=0,OS=0,OB=0,CS=0,CB=0;OP=0;for(cnt=0;cnt<OrdersTotal();cnt++){OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if((OrderType()==OP_SELL||OrderType()==OP_BUY)&&OrderSymbol()==Symbol()&&((OrderMagicNumber()==Magic)||Magic==0))OP=OP+1;}

if(OP>=1){OS=0; OB=0;}OB=0;OS=0;CB=0;CS=0;

 

//entry conditions verification

if(SV>0){OS=1;OB=0;}if(BV>0){OB=1;OS=0;}

 

//conditions to close positions

if((SV>0)

//||(UseHiddenSL&&(OrderOpenPrice()-Ask)/Point>=HiddenSL)||(UseHiddenTP&&(Bid-OrderOpenPrice())/Point>=HiddenTP)

){CB=1;}

if((BV>0)

//||(UseHiddenSL&&(Bid-OrderOpenPrice())/Point>=HiddenSL)||(UseHiddenTP&&(OrderOpenPrice()-Ask)/Point>=HiddenTP)

){CS=1;}

for(cnt=0;cnt<OrdersTotal();cnt++){OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if(OrderType()==OP_BUY&&OrderSymbol()==Symbol()&&((OrderMagicNumber()==Magic)||Magic==0)){if(CB==1){OrderClose(OrderTicket(),OrderLots(),Bid,Slippage,Red);return(0);}}

if(OrderType()==OP_SELL&&OrderSymbol()==Symbol()&&((OrderMagicNumber()==Magic)||Magic==0)){if(CS==1){OrderClose(OrderTicket(),OrderLots(),Ask,Slippage,Red);return(0);}}}

 

 

//open position

if((AddP()&&AddPositions&&OP<=MaxOrders)||(OP==0&&!AddPositions)){

if(OS==1){if(TP==0)TPI=0;else TPI=Bid-TP*Point;if(SL==0)SLI=0;else SLI=Bid+SL*Point;

TK=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SLI,TPI,EAName,Magic,0,Red);OS=0;return(0);}

if(OB==1){if(TP==0)TPI=0;else TPI=Ask+TP*Point;if(SL==0)SLI=0;else SLI=Ask-SL*Point;

TK=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SLI,TPI,EAName,Magic,0,Lime);OB=0;return(0);}}

for(j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELECT_BY_POS,MODE_TRADES)){if(OrderSymbol()==Symbol()&&((OrderMagicNumber()==Magic)||Magic==0)){TrP();}}}

 

//not enough money message to continue the martingale

if(TK<0){if (GetLastError()==134){err=1;Print("NOT ENOGUGHT MONEY!!");}return (-1);}

 

return(0);}

 

//trailing stop and breakeven

void TrP(){int BE=BreakEven;int TS=TrailingStop;double pb,pa,pp;pp=MarketInfo(OrderSymbol(),MODE_POINT);if(OrderType()==OP_BUY){pb=MarketInfo(OrderSymbol(),MODE_BID);if(BE>0){

if((pb-OrderOpenPrice())>BE*pp){if((OrderStopLoss()-OrderOpenPrice())<0){ModSL(OrderOpenPrice()+0*pp);}}}if(TS>0){if((pb-OrderOpenPrice())>TS*pp){

if(OrderStopLoss()<pb-(TS+TrailingStep-1)*pp){ModSL(pb-TS*pp);return;}}}}if(OrderType()==OP_SELL){pa=MarketInfo(OrderSymbol(),MODE_ASK);

if(BE>0){if((OrderOpenPrice()-pa)>BE*pp){if((OrderOpenPrice()-OrderStopLoss())<0){ModSL(OrderOpenPrice()-0*pp);}}}if(TS>0){if(OrderOpenPrice()-pa>TS*pp){

if(OrderStopLoss()>pa+(TS+TrailingStep-1)*pp||OrderStopLoss()==0){ModSL(pa+TS*pp);return;}}}}}

 

//stop loss modification function

void ModSL(double ldSL){bool fm;fm=OrderModify(OrderTicket(),OrderOpenPrice(),ldSL,OrderTakeProfit(),0,CLR_NONE);}

 

//add positions function

bool AddP(){int _num=0; int _ot=0;

for (int j=0;j<OrdersTotal();j++){if(OrderSelect(j,SELECT_BY_POS)==true && OrderSymbol()==Symbol()&&OrderType()<3&&((OrderMagicNumber()==Magic)||Magic==0)){

_num++;if(OrderOpenTime()>_ot) _ot=OrderOpenTime();}}if(_num==0) return(true);if(_num>0 && ((Time[0]-_ot))>0) return(true);else return(false);}

Link to comment
Share on other sites

Re: Cowabunga system indicator and EA

 

#property copyright "TF 15M"

#define EAName "RSI Pmax"

extern string S1a="---------------- Daily Bar Settings";

extern bool DailyBarFilter=false;

extern int ShiftD1=1;

extern int ShiftD2=2;

extern string S1b="---------------- Current Bar Settings";

extern int Shift1=1;

extern int Shift2=2;

extern string S1c="---------------- RSI Settings";

extern int SignalTimeFrame=15;

extern int RSIPeriod1=9;

extern string b01="Buy when between these and rising";

extern int RSIBuyLevel1=50;

extern int RSIBuyLevel1a=70;

extern string s01="Sell when between these and decreasing";

extern int RSISellLevel1=50;

extern int RSISellLevel1a=30;

extern string S2b="---------------- 2nD Settings";

extern string S2c="---------Show the trend";

extern int RSIPeriod2=9;

extern string S2d="If Under-Over allow to trade";

extern int RSIBuyLevel2=30;

extern int RSISellLevel2=70;

extern int MainTimeFrame=240;

extern string S2e="If Under-Over allow to trade";

extern int MACDFast2=12;

extern int MACDSlow2=26;

extern int MACDSMA2=9;

extern int MACDBuyLevel2=0;

extern int MACDSellLevel2=0;

 

extern string S2="---------------- Money Management";

 

extern double Lots=0.1;//|-----------------------lots size

extern bool RiskMM=false;//|---------------------risk management

extern double RiskPercent=1;//|------------------risk percentage

extern string S3="---------------- Order Management";

extern int StopLoss=0;//|------------------------stop loss

extern int TakeProfit=0;//|----------------------take profit

extern bool HideSL=false;//|---------------------hide stop loss

extern bool HideTP=false;//|---------------------hide take profit

extern int TrailingStop=0;//|--------------------trailing stop

extern int TrailingStep=0;//|--------------------trailing step

extern int BreakEven=0;//|-----------------------break even

extern int MaxOrders=100;//|---------------------maximum orders allowed

extern int Slippage=3;//|------------------------slippage

extern int Magic=2009;//|------------------------magic number

extern string S6="---------------- Extras";

extern bool Hedge=false;//|----------------------enter an opposite trade

extern bool ReverseSystem=false;//|--------------buy instead of sell, sell instead of buy

datetime PreviousBarTime1;

datetime PreviousBarTime2;

double maxEquity,minEquity,Balance=0.0;

int init()

{

return(0);

}

 

int start()

{

if(TrailingStop>0)MoveTrailingStop();

if(BreakEven>0)MoveBreakEven();

int limit=1;

for(int i=1;i<=limit;i++)

{

double RSIM15=iRSI(NULL,SignalTimeFrame,RSIPeriod1,PRICE_CLOSE,i);

double RSIM15a=iRSI(NULL,SignalTimeFrame,RSIPeriod1,PRICE_CLOSE,i);

double RSIM15b=iRSI(NULL,SignalTimeFrame,RSIPeriod1,PRICE_CLOSE,i+1);

double MACM15=iMACD(NULL,SignalTimeFrame,MACDFast2,MACDSlow2,MACDSMA2,PRICE_CLOSE,MODE_MAIN,0);

double RSI1=iRSI(NULL,MainTimeFrame,RSIPeriod2,PRICE_CLOSE,i);

 

string BUY="false";

string SELL="false";

 

if((RSIM15>RSIBuyLevel1 && RSIM15<RSIBuyLevel1a && RSIM15a>RSIM15b && MACM15 < MACDBuyLevel2 && RSI1 < RSIBuyLevel2)&&Open[shift1]>Open[shift2]&&(DailyBarFilter==false||(DailyBarFilter&&iClose(NULL,PERIOD_D1,ShiftD1)>iClose(NULL,PERIOD_D1,ShiftD2))))BUY="true";

if((RSIM15<RSISellLevel1 && RSIM15>RSISellLevel1a && RSIM15a<RSIM15b && MACM15 > MACDSellLevel2 && RSI1 > RSISellLevel2)&&Open[shift1]<Open[shift2]&&(DailyBarFilter==false||(DailyBarFilter&&iClose(NULL,PERIOD_D1,ShiftD1)<iClose(NULL,PERIOD_D1,ShiftD2))))SELL="true";

 

string SignalBUY="false";

string SignalSELL="false";

 

if(BUY=="true"/*&&MABUY=="true"*/)if(ReverseSystem)SignalSELL="true";else SignalBUY="true";

if(SELL=="true"/*&&MASELL=="true"*/)if(ReverseSystem)SignalBUY="true";else SignalSELL="true";

 

}

if(RiskMM)CalculateMM();

double SL,TP,SLP,TPP,OPP;

int Ticket,TicketH,TicketP,Expire=0;

if(OrdersTotal()<MaxOrders)

{

if (SignalBUY=="true"&&NewBarBuy())

{

if(HideSL==false&&StopLoss>0){SL=Ask-StopLoss*Point;/*OPP=Bid-StopLoss*Point;SLP=Bid;*/}else {SL=0;}

if(SL>0&&SL>(Bid-MarketInfo(Symbol(),MODE_STOPLEVEL)*Point)){SL=Bid-MarketInfo(Symbol(),MODE_STOPLEVEL)*Point;}

if(HideTP==false&&TakeProfit>0){TP=Ask+TakeProfit*Point;/*TPP=Bid-(TakeProfit*2)*Point;*/}else {TP=0;/*TPP=0;*/}

 

Ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,SL,TP,EAName,Magic,0,Blue);

if(Hedge)TicketH=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,TP,SL,EAName,Magic,0,Red);

/*if(ReverseAtStop&&StopLoss>0)TicketP=OrderSend(Symbol(),OP_SELLSTOP,Lots,OPP,Slippage,SLP,TPP,EAName,Magic,Expire,Red);*/

}

if (SignalSELL=="true"&&NewBarSell())

{

if(HideSL==false&&StopLoss>0){SL=Bid+StopLoss*Point;/*OPP=Ask+StopLoss*Point;SLP=Ask;*/}else {SL=0;}

if(SL>0&&SL<(Ask+MarketInfo(Symbol(),MODE_STOPLEVEL)*Point)){SL=Ask+MarketInfo(Symbol(),MODE_STOPLEVEL)*Point;}

if(HideTP==false&&TakeProfit>0){TP=Bid-TakeProfit*Point;/*TPP=Ask+(TakeProfit*2)*Point;*/}else {TP=0;/*TPP=0;*/}

 

Ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,SL,TP,EAName,Magic,0,Red);

if(Hedge)TicketH=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,TP,SL,EAName,Magic,0,Blue);

}

}

 

//|---------close orders

 

if(Hedge==false)

{

if((SELL=="true")||(ReverseSystem==false&&HideSL&&(OrderOpenPrice()-Ask)/Point>=StopLoss)||(ReverseSystem==false&&HideTP&&(Bid-OrderOpenPrice())/Point>=TakeProfit)||(ReverseSystem&&HideSL&&(Bid-OrderOpenPrice())/Point>=StopLoss)||(ReverseSystem&&HideTP&&(OrderOpenPrice()-Ask)/Point>=TakeProfit))

{

if(ReverseSystem)CloseSellOrders(Magic);else CloseBuyOrders(Magic);

}

if((BUY=="true")||(ReverseSystem==false&&HideSL&&(Bid-OrderOpenPrice())/Point>=StopLoss)||(ReverseSystem==false&&HideTP&&(OrderOpenPrice()-Ask)/Point>=TakeProfit)||(ReverseSystem&&HideSL&&(OrderOpenPrice()-Ask)/Point>=StopLoss)||(ReverseSystem&&HideTP&&(Bid-OrderOpenPrice())/Point>=TakeProfit))

{

if(ReverseSystem)CloseBuyOrders(Magic);else CloseSellOrders(Magic);

}

}

else

{

if((HideSL&&StopLoss>0&&(OrderOpenPrice()-Ask)/Point>=StopLoss)||(HideTP&&TakeProfit>0&&(Bid-OrderOpenPrice())/Point>=TakeProfit))

{

CloseBuyOrders(Magic);

}

if((HideSL&&StopLoss>0&&(Bid-OrderOpenPrice())/Point>=StopLoss)||(HideTP&&TakeProfit>0&&(OrderOpenPrice()-Ask)/Point>=TakeProfit))

{

CloseSellOrders(Magic);

}

}

int err=0;

if(Ticket<0)

{

if(GetLastError()==134)

{

err=1;

Print("Not enough money!");

}

return (-1);

}

 

return(0);

}

int CloseBuyOrders(int Magic)

{

int result,total=OrdersTotal();

 

for (int cnt=total-1;cnt>=0;cnt--)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if(OrderMagicNumber()==Magic&&OrderSymbol()==Symbol())

{

if(OrderType()==OP_BUY)

{

OrderClose(OrderTicket(),OrderLots(),Bid,3);

switch(OrderType())

{

case OP_BUYLIMIT:

case OP_BUYSTOP:

result=OrderDelete(OrderTicket());

}

}

}

}

return(0);

}

 

int CloseSellOrders(int Magic)

{

int result,total=OrdersTotal();

 

for(int cnt=total-1;cnt>=0;cnt--)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if(OrderMagicNumber()==Magic&&OrderSymbol()==Symbol())

{

if(OrderType()==OP_SELL)

{

OrderClose(OrderTicket(),OrderLots(),Ask,3);

switch(OrderType())

{

case OP_SELLLIMIT:

case OP_SELLSTOP:

result=OrderDelete(OrderTicket());

}

}

}

}

return(0);

}

 

//|---------trailing stop

 

void MoveTrailingStop()

{

int cnt,total=OrdersTotal();

for(cnt=0;cnt<total;cnt++)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if(OrderType()<=OP_SELL&&OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)

{

if(OrderType()==OP_BUY)

{

if(TrailingStop>0)

{

if((NormalizeDouble(OrderStopLoss(),Digits)<NormalizeDouble(Bid-Point*(TrailingStop+TrailingStep),Digits))||(OrderStopLoss()==0))

{

OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Bid-Point*TrailingStop,Digits),OrderTakeProfit(),0,Blue);

return(0);

}

}

}

else

{

if(TrailingStop>0)

{

if((NormalizeDouble(OrderStopLoss(),Digits)>(NormalizeDouble(Ask+Point*(TrailingStop+TrailingStep),Digits)))||(OrderStopLoss()==0))

{

OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(Ask+Point*TrailingStop,Digits),OrderTakeProfit(),0,Red);

return(0);

}

}

}

}

}

}

void MoveBreakEven()

{

int cnt,total=OrdersTotal();

for(cnt=0;cnt<total;cnt++)

{

OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);

if(OrderType()<=OP_SELL&&OrderSymbol()==Symbol()&&OrderMagicNumber()==Magic)

{

if(OrderType()==OP_BUY)

{

if(BreakEven>0)

{

if(NormalizeDouble((Bid-OrderOpenPrice()),Digits)>BreakEven*Point)

{

if(NormalizeDouble((OrderStopLoss()-OrderOpenPrice()),Digits)<0)

{

OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()+0*Point,Digits),OrderTakeProfit(),0,Blue);

return(0);

}

}

}

}

else

{

if(BreakEven>0)

{

if(NormalizeDouble((OrderOpenPrice()-Ask),Digits)>BreakEven*Point)

{

if(NormalizeDouble((OrderOpenPrice()-OrderStopLoss()),Digits)<0)

{

OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()-0*Point,Digits),OrderTakeProfit(),0,Red);

return(0);

}

}

}

}

}

}

}

 

//|---------allow one action per bar

 

bool NewBarBuy()

{

if(PreviousBarTime1<Time[0])

{

PreviousBarTime1=Time[0];

return(true);

}

return(false);

}

 

bool NewBarSell()

{

if(PreviousBarTime2<Time[0])

{

PreviousBarTime2=Time[0];

return(true);

}

return(false);

}

 

//|---------calculate money management

 

void CalculateMM()

{

double MinLots=MarketInfo(Symbol(),MODE_MINLOT);

double MaxLots=MarketInfo(Symbol(),MODE_MAXLOT);

Lots=AccountFreeMargin()/100000*RiskPercent;

Lots=MathMin(MaxLots,MathMax(MinLots,Lots));

if(MinLots<0.1)Lots=NormalizeDouble(Lots,2);

else

{

if(MinLots<1)Lots=NormalizeDouble(Lots,1);

else Lots=NormalizeDouble(Lots,0);

}

if(Lots<MinLots)Lots=MinLots;

if(Lots>MaxLots)Lots=MaxLots;

return(0);

}

Link to comment
Share on other sites

Re: Cowabunga system indicator and EA

 

Here is mq4 and backtest result since 2001 for RSI Power Maximum. Any suggestion for how to do optimization?

Sorry, but I never use this, its too dangerous and simple (mean "your account will blow up" earlier or later..) it is one of my first ea's I only do it for "fun"..:-S :) but the most important is the rsi long-short level

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...