Register
Welcome to Forex-TSD! , one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.
From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.
Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
Elite Section
Get access to private discussions, specialized support, indicators and trading systems reported every week.
Advanced Elite Section
For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more
02-06-2009, 11:01 AM
Member
Join Date: Sep 2008
Posts: 33
Parabolic sar based ea
Hi everyone,
I'm just a newbie in EA realm... and i'm sorry for my english.. i'm from Indonesia.
i'd like to ask for help in this great forum... i made this EA a couple weeks ago.. it's based on Parabolic SAR in multi time frame.. but i need to change the rule...
In previous rule, the EA waits for all PSAR in all time frame to be the same in direction and the signal for OP comes from direction change in smallest Time Frame.
In current rule, the EA still wait for all PSAR in all time frame to be the same in direction BUT the signal for OP come from any Time Frame. Meaning: Whenever All the PSAR has same direction the EA will take position.
You may want to take a look at my thread of this EA
HERE
The EA needs to be changed because current rule will be more promising. Could somebody please help check my code in post #3 bellow? I have forward tested but no OP at all, i don't know what's wrong.
PSAR_EA_02 (Feb05) is coded with previous rule
EA PASAR CUMI v.2 is with current rule (but i'm sure there's something wrong in my coding)
Thanx in advance.
[IMG]
[/IMG]
Last edited by silumancumi; 02-06-2009 at 11:45 AM .
02-06-2009, 11:08 AM
Member
Join Date: Sep 2008
Posts: 33
These are screenshots to ilustrate the logic behind the CURRENT RULE, i'm sorry if it's too big.
The green-red bar is Par SAR, take position whenever all the bars have same colour.
[IMG]
[/IMG]
[IMG]
[/IMG]
[IMG]
[/IMG]
[IMG]
[/IMG]
02-06-2009, 11:38 AM
Member
Join Date: Sep 2008
Posts: 33
EA PASAR CUMI V.2 (current rule), could somebody please tell me what's wrong?
Code:
extern double Lots=1;
extern int StopLoss=40;
extern int TakeProfit=20;
extern string txComment="Order PSAR";
extern int MagicNumber=12345;
extern int Slippage=3;
extern int MaxOrders=5;
//Parameter TF0
extern string note1 = "--- Parameter PSar 1 ---";
extern int TF0 = 1;
extern double step0 = 0.005;
extern double maximum0 = 0.2;
//end
//Parameter TF1
extern string note2 = "--- Parameter PSar 2 ---";
extern int TF1 = 5;
extern double step1 = 0.005;
extern double maximum1 = 0.2;
//end
//Parameter TF2
extern string note3 = "--- Parameter PSar 3 ---";
extern int TF2 = 15;
extern double step2 = 0.005;
extern double maximum2 = 0.2;
//end
//Parameter TF3
extern string note4 = "--- Parameter PSar 4 ---";
extern int TF3 = 30;
extern double step3 = 0.005;
extern double maximum3 = 0.2;
//end
//Parameter TF4
extern string note5 = "--- Parameter PSar 5 ---";
extern int TF4 = 60;
extern double step4 = 0.005;
extern double maximum4 = 0.2;
//end
//Parameter TF5
extern string note6 = "--- Parameter PSar 6 ---";
extern int TF5 = 240;
extern double step5 = 0.005;
extern double maximum5 = 0.2;
//end
/*
Minor update by metropolis:
Trailing stop function
5 digits broker issues fixed
one signal for one position
*/
extern int TrailingStop =0;
///////////////////////////////////////
datetime bartime=0;
int tiket;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
////////////////////////////// 1st Previous Trend ; 1 means Bullish ; 0 means Bearish ///////////////////////////
//// Bullish ////
if (iSAR(NULL,TF0,step0,maximum0,1)<Close[0]) {int TrendP1_0 = 1; string TrendP1_0s="Bullish";}
if (iSAR(NULL,TF1,step1,maximum1,1)<Close[0]) {int TrendP1_1 = 1; string TrendP1_1s="Bullish";}
if (iSAR(NULL,TF2,step2,maximum2,1)<Close[0]) {int TrendP1_2 = 1; string TrendP1_2s="Bullish";}
if (iSAR(NULL,TF3,step3,maximum3,1)<Close[0]) {int TrendP1_3 = 1; string TrendP1_3s="Bullish";}
if (iSAR(NULL,TF4,step4,maximum4,1)<Close[0]) {int TrendP1_4 = 1; string TrendP1_4s="Bullish";}
if (iSAR(NULL,TF5,step5,maximum5,1)<Close[0]) {int TrendP1_5 = 1; string TrendP1_5s="Bullish";}
//// Bearish ////
if (iSAR(NULL,TF0,step0,maximum0,1)>Close[0]) {TrendP1_0 = 0; TrendP1_0s="Bearish";}
if (iSAR(NULL,TF1,step1,maximum1,1)>Close[0]) {TrendP1_1 = 0; TrendP1_1s="Bearish";}
if (iSAR(NULL,TF2,step2,maximum2,1)>Close[0]) {TrendP1_2 = 0; TrendP1_2s="Bearish";}
if (iSAR(NULL,TF3,step3,maximum3,1)>Close[0]) {TrendP1_3 = 0; TrendP1_3s="Bearish";}
if (iSAR(NULL,TF4,step4,maximum4,1)>Close[0]) {TrendP1_4 = 0; TrendP1_4s="Bearish";}
if (iSAR(NULL,TF5,step5,maximum5,1)>Close[0]) {TrendP1_5 = 0; TrendP1_5s="Bearish";}
///////////////////////////////// 2nd Previous Trend ; 1 means Bullish ; 0 means Bearish /////////////////////////
//// Bullish ////
if (iSAR(NULL,TF0,step0,maximum0,2)<Close[0]) {int TrendP2_0 = 1;}
if (iSAR(NULL,TF1,step1,maximum1,2)<Close[0]) {int TrendP2_1 = 1;}
if (iSAR(NULL,TF2,step2,maximum2,2)<Close[0]) {int TrendP2_2 = 1;}
if (iSAR(NULL,TF3,step3,maximum3,2)<Close[0]) {int TrendP2_3 = 1;}
if (iSAR(NULL,TF4,step4,maximum4,2)<Close[0]) {int TrendP2_4 = 1;}
if (iSAR(NULL,TF5,step5,maximum5,2)<Close[0]) {int TrendP2_5 = 1;}
//// Bearish ////
if (iSAR(NULL,TF0,step0,maximum0,2)>Close[0]) {TrendP2_0 = 0;}
if (iSAR(NULL,TF1,step1,maximum1,2)>Close[0]) {TrendP2_1 = 0;}
if (iSAR(NULL,TF2,step2,maximum2,2)>Close[0]) {TrendP2_2 = 0;}
if (iSAR(NULL,TF3,step3,maximum3,2)>Close[0]) {TrendP2_3 = 0;}
if (iSAR(NULL,TF4,step4,maximum4,2)>Close[0]) {TrendP2_4 = 0;}
if (iSAR(NULL,TF5,step5,maximum5,2)>Close[0]) {TrendP2_5 = 0;}
string Signal = "NONE";
static string LastSignal = "NONE";
///////////////////////////// 1st previous Signal ////////////////////////////
if (TrendP1_0==1 && TrendP1_1==1 && TrendP1_2==1 && TrendP1_3==1 && TrendP1_4==1 && TrendP1_5==1)
{int TrendP1=1;} //All 1st prev Bullish
else if (TrendP1_0==0 && TrendP1_1==0 && TrendP1_2==0 && TrendP1_3==0 && TrendP1_4==0 && TrendP1_5==0)
{TrendP1=0;} //All 1st prev Bearish
///////////////////////////// 2nd previous Signal ////////////////////////////
if (TrendP2_0==1 && TrendP2_1==1 && TrendP2_2==1 && TrendP2_3==1 && TrendP2_4==1 && TrendP2_5==1)
{int TrendP2=1;} //All 2nd prev Bullish
else if (TrendP2_0==0 && TrendP2_1==0 && TrendP2_2==0 && TrendP2_3==0 && TrendP2_4==0 && TrendP2_5==0)
{TrendP2=0;} //All 2nd prev Bearish
////////////////////////////// Open Position /////////////////////////////
if (OrdersTotal()<MaxOrders && bartime != Time[0])
{if (TrendP1==1 && TrendP2!=0 && TrendP2!=1) /// if 1st previous ALL bullish, and 2nd previos NOT ALL same signal
{Signal = "LONG (BUY)";
LastSignal = Signal;
tiket = OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,Ask-StopLoss*pointt(),Ask+TakeProfit*pointt(),txComment,MagicNumber,0,Green);
if(tiket>0) bartime = Time[0];}
else if
(TrendP1==0 && TrendP2!=0 && TrendP2!=1) /// if 1st previous ALL bearish, and 2nd previous NOT ALL same signal
{Signal = "SHORT (SELL)";
LastSignal = Signal;
tiket = OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,Bid+StopLoss*pointt(),Bid-TakeProfit*pointt(),txComment,MagicNumber,0,Red);
if(tiket>0) bartime = Time[0];}
}
Comment("n",
"n EA PASAR CUMI V.2",
"n",
"n"," Broker time= ",TimeToStr(TimeCurrent()),
"n",
"n"," Trend TF ",(TF0)," M = ",(TrendP1_0s),
"n"," Trend TF ",(TF1)," M = ",(TrendP1_1s),
"n"," Trend TF ",(TF2)," M = ",(TrendP1_2s),
"n"," Trend TF ",(TF3)," M = ",(TrendP1_3s),
"n"," Trend TF ",(TF4)," M = ",(TrendP1_4s),
"n"," Trend TF ",(TF5)," M = ",(TrendP1_5s),
"n"," Last Signal = ",(LastSignal),
"n"," Current Signal = ",(Signal),
"n",
"n"," Equity = ",AccountEquity());
//////////Trailing Stop is here//////////////
for (int i = 0; i < OrdersTotal(); i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber && TrailingStop>0)
{
if(OrderType()==OP_BUY)
{
if(Bid-OrderOpenPrice()>pointt()*TrailingStop)
{
if(OrderStopLoss()<Bid-pointt()*TrailingStop || (OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Bid-pointt()*TrailingStop,OrderTakeProfit(),0,CLR_NONE);
return(0);
}
}
}
if(OrderType()==OP_SELL)
{
if((OrderOpenPrice()-Ask)>(pointt()*TrailingStop))
{
if((OrderStopLoss()>(Ask+pointt()*TrailingStop)) || (OrderStopLoss()==0))
{
OrderModify(OrderTicket(),OrderOpenPrice(),Ask+pointt()*TrailingStop,OrderTakeProfit(),0,CLR_NONE);
return(0);
}
}
}
}
}
return(0);
}
//+------------------------------------------------------------------+
double pointt()
{
if(Digits==2) return(0.01);
if(Digits==4) return(0.0001);
if(Digits==5 || Digits==3) return(0.00001);
}
02-19-2009, 09:29 AM
Junior Member
Join Date: Jul 2007
Posts: 5
Modifications
Sorry... I've modified this EA, if it's not correct yet. If it's not satisfy enough, please tell me....
Last edited by luckytea; 02-24-2009 at 05:51 AM .
Reason: Languange it's not english
02-20-2009, 02:43 AM
User Root
Join Date: May 2006
Location: Helliconia (Winter)
Posts: 4,410
Quote:
Originally Posted by
luckytea
kalo masih ada yang kurang bener, kasi tau saya ya....
English please...
02-20-2009, 03:22 AM
Junior Member
Join Date: Feb 2009
Posts: 2
siumancumi
Any luck with your EA?
02-26-2009, 03:18 PM
Junior Member
Join Date: Oct 2006
Posts: 5
Can you please provide para 4tf indicator so that ea can be tested.
02-28-2009, 12:49 PM
Senior Member
Join Date: Mar 2008
Posts: 426
Quote:
Originally Posted by
Everett
Can you please provide para 4tf indicator so that ea can be tested.
Yes, I would like that, too. Looks like this could make for a good
manual system.
Rob
03-01-2009, 04:39 PM
Member
Join Date: Oct 2007
Location: USA
Posts: 37
Quote:
Originally Posted by
ChicagoRob
Yes, I would like that, too. Looks like this could make for a good
manual system.
Rob
Try this,hope it helps.regards
03-01-2009, 04:44 PM
Member
Join Date: Oct 2007
Location: USA
Posts: 37
Voice alert on MTF psar
Greetings to all, Can someone make a voice alert (both buy and sell) with arrows on the attached indicator when all blue or red are in the same direction?
Thanking you in advance
Last edited by traderlab; 03-01-2009 at 04:49 PM .
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT. The time now is 08:50 AM .