Forex



Go Back   Forex Trading > Programming > MetaTrader
Forex Forum Register More recent Blogs Calendar Advertising Others Help






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

Reply
 
Thread Tools Display Modes
  #991 (permalink)  
Old 06-09-2008, 11:17 AM
Senior Member
 
Join Date: Mar 2006
Location: La Verne,CA
Posts: 560
MrPip is on a distinguished road
Quote:
Originally Posted by mauro269 View Post
I have another simple questio, that I can't solve.
I would like to open multiposition for every signal that I receive. Exactly I would like to open 3 position for every signal, what's the code to do this.
Regards
Just use 3 OrderSend calls instead of 1.

Robert
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #992 (permalink)  
Old 06-09-2008, 04:30 PM
Junior Member
 
Join Date: Dec 2005
Posts: 11
graemenash is on a distinguished road
Variable problem

Hi,

I am currenty programming an expert which does calculations based on the OHLC of the previous bar.

My problem is this:

I have a variable called "var5".

For the first bar that is counted, var5 is the open of that bar.

For every subsequent bar, var5 is the value of var5 on the previous bar, divided by 2.

I have no idea how to code this into MQL, and was wondering if anyone could show me an example of how this might be done?

Thanks in advance for any replies.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #993 (permalink)  
Old 06-09-2008, 05:51 PM
Junior Member
 
Join Date: Jun 2008
Posts: 9
panteraschoice is on a distinguished road
only buy, no sell

creating a profitable ea, but it could be twice as good (maybe) for now only buys are placed, never sellorders.
Anyone knows why?

//+------------------------------------------------------------------+
//| Signal Begin |
//+------------------------------------------------------------------+

double sig_buy = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 0, 0);
double sig_sell = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 1, 0);

double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1);




if (sig_buy>0 && Sg>0) Order = SIGNAL_BUY;
if (sig_sell>0 && Sg<0 ) Order = SIGNAL_SELL;

//+------------------------------------------------------------------+
//| Signal End |
//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #994 (permalink)  
Old 06-09-2008, 07:05 PM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 652
Blog Entries: 1
IN10TION is on a distinguished road
publish the total code, there is another thing wrong...
the second step is perhaps your iCustom() functions.

Quote:
Originally Posted by panteraschoice View Post
creating a profitable ea, but it could be twice as good (maybe) for now only buys are placed, never sellorders.
Anyone knows why?

//+------------------------------------------------------------------+
//| Signal Begin |
//+------------------------------------------------------------------+

double sig_buy = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 0, 0);
double sig_sell = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 1, 0);

double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1);




if (sig_buy>0 && Sg>0) Order = SIGNAL_BUY;
if (sig_sell>0 && Sg<0 ) Order = SIGNAL_SELL;

//+------------------------------------------------------------------+
//| Signal End |
//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #995 (permalink)  
Old 06-10-2008, 04:01 AM
Junior Member
 
Join Date: Sep 2006
Posts: 1
valoncross is on a distinguished road
Question Placing & Viewing Objects on Future Dates?

Hi, does anyone know if MQL4 supports placing an indicator object into the future and viewing the future object? I tried ObjectMove to a future date (no error return), but the display stops at the last tick date. Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #996 (permalink)  
Old 06-10-2008, 05:38 AM
Mr.Marketz's Avatar
Senior Member
 
Join Date: Feb 2006
Posts: 350
Mr.Marketz is on a distinguished road
The MA's have a shift feature... if that's what you mean. +2 will slide it foreward 2 TF bars. -2 will slide back 2.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #997 (permalink)  
Old 06-10-2008, 07:52 AM
Junior Member
 
Join Date: Jun 2008
Posts: 9
panteraschoice is on a distinguished road
Quote:
Originally Posted by IN10TION View Post
publish the total code, there is another thing wrong...
the second step is perhaps your iCustom() functions.
#property link "http://www.forex-tsd.com"

extern int MagicNumber = 1001;
extern bool EachTickMode = False;
extern double Lots = 0.01;
extern int Slippage = 4;
extern bool StopLossMode = True;
extern int StopLoss = 70;
extern bool TakeProfitMode = True;
extern int TakeProfit = 300;
extern bool TrailingStopMode = True;
extern int TrailingStop = 25;
extern double MaximumRisk =0;//0.15
extern double DecreaseFactor =3;
extern int MaxOrders = 3000;
extern bool UseHourTrade = False;
extern int FromHourTrade = 8;
extern int ToHourTrade = 18;


#define SIGNAL_NONE 0
#define SIGNAL_BUY 1
#define SIGNAL_SELL 2
#define SIGNAL_CLOSEBUY 3
#define SIGNAL_CLOSESELL 4

int BarCount;
int Current;
bool TickCheck = False;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init() {
BarCount = Bars;

if (EachTickMode) Current = 0; else Current = 1;

return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit() {
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start() {
if (UseHourTrade){
if (!(Hour()>=FromHourTrade && Hour()<=ToHourTrade)) {
Comment("Time for trade has not come else!");
return(0);
}
}
int Order = SIGNAL_NONE;
int Total, Ticket;
double StopLossLevel, TakeProfitLevel;

int digit = MarketInfo(Symbol(),MODE_DIGITS);

if (EachTickMode && Bars != BarCount) EachTickMode = False;
Total = OrdersTotal();
Order = SIGNAL_NONE;

//+------------------------------------------------------------------+
//| Signal Begin |
//+------------------------------------------------------------------+



double sig_buy = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 0, 0);
double sig_sell = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 1, 0);

double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1);




if (sig_buy>0 && Sg>0) Order = SIGNAL_BUY;
if (sig_sell>0 && Sg<0 ) Order = SIGNAL_SELL;


//+------------------------------------------------------------------+
//| Signal End |
//+------------------------------------------------------------------+

//Buy
if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
if(ScanTrades() < MaxOrders) {
//Check free margin
if (AccountFreeMargin() < (1000 * Lots)) {
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}

StopLossLevel = Ask - StopLoss * Point;
TakeProfitLevel = Ask + TakeProfit * Point;
Ticket = OrderSend(Symbol(), OP_BUY, LotsOptimized(),
NormalizeDouble(Ask,digit),
Slippage,
NormalizeDouble(StopLossLevel,digit),
NormalizeDouble(TakeProfitLevel,digit),
"Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
if(Ticket > 0) {
if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice()); else Print("Error opening BUY order : ", GetLastError());
}
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
}

//Sell
if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
if(ScanTrades() < MaxOrders) {
//Check free margin
if (AccountFreeMargin() < (1000 * Lots)) {
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
StopLossLevel = Bid + StopLoss * Point;
TakeProfitLevel = Bid - TakeProfit * Point;
Ticket = OrderSend(Symbol(), OP_SELL, LotsOptimized(),
NormalizeDouble(Bid,digit),
Slippage,
NormalizeDouble(StopLossLevel,digit),
NormalizeDouble(TakeProfitLevel,digit),
"Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);



if(Ticket > 0) {
if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice()); else Print("Error opening SELL order : ", GetLastError());
}
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
}

//Check position
for (int i = 0; i < Total; i ++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
if(OrderType() == OP_BUY && OrderMagicNumber()==MagicNumber ) {
//Close
if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, MediumSeaGreen);
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
//Trailing stop
if(TrailingStopMode && TrailingStop > 0) {
if(Bid - OrderOpenPrice() > Point * TrailingStop) {
if(OrderStopLoss() < Bid - Point * TrailingStop) {
OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
if (!EachTickMode) BarCount = Bars;
return(0);
}
}
}
} else {
if(OrderType()==OP_SELL && OrderMagicNumber()==MagicNumber)
{

//Close
if (Order == SIGNAL_CLOSESELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount))))
{
OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, DarkOrange);
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
//Trailing stop
if (TrailingStopMode && TrailingStop > 0)
{
if((OrderOpenPrice() - Ask) > (Point * TrailingStop)) {
if((OrderStopLoss() > (Ask + Point * TrailingStop)) || (OrderStopLoss() == 0)) {
OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);
if (!EachTickMode) BarCount = Bars;
return(0);
}
}
}
}}
}
}

if (!EachTickMode) BarCount = Bars;

return(0);
}

int ScanTrades()
{
int total = OrdersTotal();
int numords = 0;

for(int cnt=0; cnt<total; cnt++)
{
OrderSelect(cnt, SELECT_BY_POS);
if(OrderSymbol() == Symbol() && OrderType()<=OP_SELLSTOP && OrderMagicNumber() == MagicNumber)
numords++;
}
return(numords);
}

//bool ExistPositions() {
// for (int i=0; i<OrdersTotal(); i++) {
// if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
// if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) {
// return(True);
// }
// }
// }
// return(false);
//}

double LotsOptimized()
{
double lot=Lots;
int orders=HistoryTotal(); // history orders total
int losses=0; // number of losses orders without a break
//---- select lot size
if(MaximumRisk>0)lot=NormalizeDouble(Lots*AccountF reeMargin()*MaximumRisk/1000.0,1);
//---- calcuulate number of losses orders without a break
if(DecreaseFactor>0)
{
for(int i=orders-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==fals e) { Print("Error in history!"); break; }
if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;
//----
if(OrderProfit()>0) break;
if(OrderProfit()<0) losses++;
}
if(losses>1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
}
//---- return lot size
if(lot<0.1) lot=0.1;
return(lot);
}


//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #998 (permalink)  
Old 06-10-2008, 08:50 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 652
Blog Entries: 1
IN10TION is on a distinguished road
Do you get any error code or something else (in backtesting) that gives you a hint what's going wrong?

Quote:
Originally Posted by panteraschoice View Post
#property link "http://www.forex-tsd.com"

extern int MagicNumber = 1001;
extern bool EachTickMode = False;
extern double Lots = 0.01;
extern int Slippage = 4;
extern bool StopLossMode = True;
extern int StopLoss = 70;
extern bool TakeProfitMode = True;
extern int TakeProfit = 300;
extern bool TrailingStopMode = True;
extern int TrailingStop = 25;
extern double MaximumRisk =0;//0.15
extern double DecreaseFactor =3;
extern int MaxOrders = 3000;
extern bool UseHourTrade = False;
extern int FromHourTrade = 8;
extern int ToHourTrade = 18;


#define SIGNAL_NONE 0
#define SIGNAL_BUY 1
#define SIGNAL_SELL 2
#define SIGNAL_CLOSEBUY 3
#define SIGNAL_CLOSESELL 4

int BarCount;
int Current;
bool TickCheck = False;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init() {
BarCount = Bars;

if (EachTickMode) Current = 0; else Current = 1;

return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit() {
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start() {
if (UseHourTrade){
if (!(Hour()>=FromHourTrade && Hour()<=ToHourTrade)) {
Comment("Time for trade has not come else!");
return(0);
}
}
int Order = SIGNAL_NONE;
int Total, Ticket;
double StopLossLevel, TakeProfitLevel;

int digit = MarketInfo(Symbol(),MODE_DIGITS);

if (EachTickMode && Bars != BarCount) EachTickMode = False;
Total = OrdersTotal();
Order = SIGNAL_NONE;

//+------------------------------------------------------------------+
//| Signal Begin |
//+------------------------------------------------------------------+



double sig_buy = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 0, 0);
double sig_sell = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 1, 0);

double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1);




if (sig_buy>0 && Sg>0) Order = SIGNAL_BUY;
if (sig_sell>0 && Sg<0 ) Order = SIGNAL_SELL;


//+------------------------------------------------------------------+
//| Signal End |
//+------------------------------------------------------------------+

//Buy
if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
if(ScanTrades() < MaxOrders) {
//Check free margin
if (AccountFreeMargin() < (1000 * Lots)) {
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}

StopLossLevel = Ask - StopLoss * Point;
TakeProfitLevel = Ask + TakeProfit * Point;
Ticket = OrderSend(Symbol(), OP_BUY, LotsOptimized(),
NormalizeDouble(Ask,digit),
Slippage,
NormalizeDouble(StopLossLevel,digit),
NormalizeDouble(TakeProfitLevel,digit),
"Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
if(Ticket > 0) {
if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("BUY order opened : ", OrderOpenPrice()); else Print("Error opening BUY order : ", GetLastError());
}
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
}

//Sell
if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
if(ScanTrades() < MaxOrders) {
//Check free margin
if (AccountFreeMargin() < (1000 * Lots)) {
Print("We have no money. Free Margin = ", AccountFreeMargin());
return(0);
}
StopLossLevel = Bid + StopLoss * Point;
TakeProfitLevel = Bid - TakeProfit * Point;
Ticket = OrderSend(Symbol(), OP_SELL, LotsOptimized(),
NormalizeDouble(Bid,digit),
Slippage,
NormalizeDouble(StopLossLevel,digit),
NormalizeDouble(TakeProfitLevel,digit),
"Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);



if(Ticket > 0) {
if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) Print("SELL order opened : ", OrderOpenPrice()); else Print("Error opening SELL order : ", GetLastError());
}
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
}

//Check position
for (int i = 0; i < Total; i ++) {
OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
if(OrderType() <= OP_SELL && OrderSymbol() == Symbol()) {
if(OrderType() == OP_BUY && OrderMagicNumber()==MagicNumber ) {
//Close
if (Order == SIGNAL_CLOSEBUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) {
OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, MediumSeaGreen);
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
//Trailing stop
if(TrailingStopMode && TrailingStop > 0) {
if(Bid - OrderOpenPrice() > Point * TrailingStop) {
if(OrderStopLoss() < Bid - Point * TrailingStop) {
OrderModify(OrderTicket(), OrderOpenPrice(), Bid - Point * TrailingStop, OrderTakeProfit(), 0, MediumSeaGreen);
if (!EachTickMode) BarCount = Bars;
return(0);
}
}
}
} else {
if(OrderType()==OP_SELL && OrderMagicNumber()==MagicNumber)
{

//Close
if (Order == SIGNAL_CLOSESELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount))))
{
OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, DarkOrange);
if (EachTickMode) TickCheck = True;
if (!EachTickMode) BarCount = Bars;
return(0);
}
//Trailing stop
if (TrailingStopMode && TrailingStop > 0)
{
if((OrderOpenPrice() - Ask) > (Point * TrailingStop)) {
if((OrderStopLoss() > (Ask + Point * TrailingStop)) || (OrderStopLoss() == 0)) {
OrderModify(OrderTicket(), OrderOpenPrice(), Ask + Point * TrailingStop, OrderTakeProfit(), 0, DarkOrange);
if (!EachTickMode) BarCount = Bars;
return(0);
}
}
}
}}
}
}

if (!EachTickMode) BarCount = Bars;

return(0);
}

int ScanTrades()
{
int total = OrdersTotal();
int numords = 0;

for(int cnt=0; cnt<total; cnt++)
{
OrderSelect(cnt, SELECT_BY_POS);
if(OrderSymbol() == Symbol() && OrderType()<=OP_SELLSTOP && OrderMagicNumber() == MagicNumber)
numords++;
}
return(numords);
}

//bool ExistPositions() {
// for (int i=0; i<OrdersTotal(); i++) {
// if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
// if (OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber) {
// return(True);
// }
// }
// }
// return(false);
//}

double LotsOptimized()
{
double lot=Lots;
int orders=HistoryTotal(); // history orders total
int losses=0; // number of losses orders without a break
//---- select lot size
if(MaximumRisk>0)lot=NormalizeDouble(Lots*AccountF reeMargin()*MaximumRisk/1000.0,1);
//---- calcuulate number of losses orders without a break
if(DecreaseFactor>0)
{
for(int i=orders-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==fals e) { Print("Error in history!"); break; }
if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;
//----
if(OrderProfit()>0) break;
if(OrderProfit()<0) losses++;
}
if(losses>1) lot=NormalizeDouble(lot-lot*losses/DecreaseFactor,1);
}
//---- return lot size
if(lot<0.1) lot=0.1;
return(lot);
}


//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #999 (permalink)  
Old 06-10-2008, 09:04 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 652
Blog Entries: 1
IN10TION is on a distinguished road
I'm doing a backtest now only with the RSIFilter, I do use the RSIMixFilter few posts ago in this thread, I published that indicator, and I do get BUYS and SELLS, so the logic to do the orders BUY and SELL are ok, the issue is with your iCustom signals...

RSIMixFilter, is not in this thread, sorry, it's here ASK

Quote:
Originally Posted by panteraschoice View Post
creating a profitable ea, but it could be twice as good (maybe) for now only buys are placed, never sellorders.
Anyone knows why?

//+------------------------------------------------------------------+
//| Signal Begin |
//+------------------------------------------------------------------+

double sig_buy = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 0, 0);
double sig_sell = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 1, 0);

double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1);




if (sig_buy>0 && Sg>0) Order = SIGNAL_BUY;
if (sig_sell>0 && Sg<0 ) Order = SIGNAL_SELL;

//+------------------------------------------------------------------+
//| Signal End |
//+------------------------------------------------------------------+

Last edited by IN10TION; 06-10-2008 at 09:12 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #1000 (permalink)  
Old 06-10-2008, 09:21 AM
IN10TION's Avatar
Senior Member
 
Join Date: Mar 2007
Posts: 652
Blog Entries: 1
IN10TION is on a distinguished road
I did some backtesting, EURUSD H1 from April 2007 till now, with this RSIMixFilter only...
Has to be 90% modelling quality, don't know why it doesn't show.

Quote:
Originally Posted by panteraschoice View Post
creating a profitable ea, but it could be twice as good (maybe) for now only buys are placed, never sellorders.
Anyone knows why?

//+------------------------------------------------------------------+
//| Signal Begin |
//+------------------------------------------------------------------+

double sig_buy = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 0, 0);
double sig_sell = iCustom(NULL, 0, "Slope Direction Line",40, 2, 0, 1, 0);

double Sg=iCustom(NULL,0,"RSIFilter_v1",5,5,0,1);

if (sig_buy>0 && Sg>0) Order = SIGNAL_BUY;
if (sig_sell>0 && Sg<0 ) Order = SIGNAL_SELL;

//+------------------------------------------------------------------+
//| Signal End |
//+------------------------------------------------------------------+
Attached Images
File Type: gif TesterGraph.gif (7.0 KB, 113 views)

Last edited by IN10TION; 06-10-2008 at 09:25 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
#include, candle time, CHinGsMAroonCLK, code, coders guru, conditionally, dll, eli hayun, Eur_harvester.ex4, expert adviser, expert advisor, forex, higher high, how to code, indicator, I_XO_A_H, kehedge, mechanical trading, metatrader command line, mt4, MT4-LevelStop-Reverse, OrderReliable.mqh, programming, rectangle tool, trading, volty channel stop


Currently Active Users Viewing This Thread: 3 (1 members and 2 guests)
luxinterior
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to code this? iscuba11 Metatrader 4 mql 4 - Development course 1 08-03-2007 05:22 PM


All times are GMT. The time now is 04:30 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.