20EMA-200EMA-RSI3 .... DD eating a profit, 3 day running
Trading correlation pairs by using the other pairs 843 replies
Export All pairs or selected pairs to .csv with script 3 replies
Pairs of Currency Pairs 4 replies
Trending Pairs / Ranging Pairs 0 replies
Robot trading 120 replies
DislikedThat is already available in the Original robot - double GetRSIbasket(int timefram, int pos) - this gives exactly the same reading as a call to the KG indi.
The calls to the function are:
LowerTfWhiteLine = GetRSIbasket(Period(), 0);
HigherTfWhiteLine = GetRSIbasket(Htf1, 0);
You would simply replace my variables with yours.
Feel free to pinch the function.
Ignored
DislikedArhhh, didn't saw this post at time!
During this time I have coded the function, following someone that give me the basketRsi.mq4.
That's work, although values are slightly different, maybe better that the indic that seems strange with the gbp (always low)Ignored
DislikedThe price shown on the error message was totally different from the actual E/J price (no wonder it couldn't close the trade).Ignored
//+------------------------------------------------------------------+
//| CloseTrades() |
//+------------------------------------------------------------------+
void CloseTrades(string symbol, int col)
{
double askSymbol = NormalizeDouble(MarketInfo(symbol, MODE_ASK),Digits);
double bidSymbol = NormalizeDouble(MarketInfo(symbol, MODE_BID),Digits);
for(int i1=OrdersTotal()-1; i1>=0; i1--)
{ OrderSelect(i1,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==symbol && (OrderMagicNumber()==magicT || OrderMagicNumber()==magicS || OrderMagicNumber()==magicH ))
{
if(OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),bidSymbol,MarketInfo(symbol,MODE_SPREAD),col);
if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),askSymbol,MarketInfo(symbol,MODE_SPREAD),col);
}//if(OrderSymbol()==Symbol().....
}//for(int......
}
//+------------------------------------------------------------------+
//| CloseHedgeTrades |
//+------------------------------------------------------------------+
void CloseHedgeTrades(string symbol, int col)
{
double askSymbol = NormalizeDouble(MarketInfo(symbol, MODE_ASK),Digits);
double bidSymbol = NormalizeDouble(MarketInfo(symbol, MODE_BID),Digits);
for(int i1=OrdersTotal()-1; i1>=0; i1--)
{ OrderSelect(i1,SELECT_BY_POS,MODE_TRADES);
if(OrderSymbol()==symbol && OrderMagicNumber()==magicH)
{
if(OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),bidSymbol,MarketInfo(symbol,MODE_SPREAD),col);
if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),askSymbol,MarketInfo(symbol,MODE_SPREAD),col);
}//if(OrderSymbol()==Symbol().....
}//for(int......
} DislikedI think that sometimes the internal functions to close orders have problems with the prices and is better to normalize also the internal Bid and Ask prices.
In your case seems also that the price comes from an other pair. To avoid this, @maxou888 can customize the close functions:
.
.
.
@maxou888, chapeau for your coding style!Ignored
DislikedI think that sometimes the internal functions to close orders have problems with the prices and is better to normalize also the internal Bid and Ask prices.
In your case seems also that the price comes from an other pair. To avoid this, @maxou888 can customize the close functions:
[code]//+------------------------------------------------------------------+
//| CloseTrades()...Ignored
DislikedI think that sometimes the internal functions to close orders have problems with the prices and is better to normalize also the internal Bid and Ask prices.Ignored
OrderClose(OrderTicket(),OrderLots(),[color=Blue]OrderClosePrice(), [/color],MarketInfo(symbol,MODE_SPREAD),col);
DislikedHi SwingMan,
In your experience will adding OrderReliable_V1_1_0.mqh (attached) as an include to an EA, TM etc help with possible problems caused by market price movements etc ?
My coding knowledge of MT4 is not good enough to know how useful these routines really are. So far they do seem to have helped in several cases.
ThanksIgnored
Disliked...I use this to close trades
I never understand why OrderClosePrice() works, just that it appears to work. Is there any reason for it not to work?Inserted CodeOrderClose(OrderTicket(),OrderLots(),[color=Blue]OrderClosePrice(), [/color],MarketInfo(symbol,MODE_SPREAD),col);Ignored
DislikedI think that sometimes the internal functions to close orders have problems with the prices and is better to normalize also the internal Bid and Ask prices.
In your case seems also that the price comes from an other pair. To avoid this, @maxou888 can customize the close functions:Ignored
DislikedThanks Steve for your information!
Sure the "OrderClosePrice()" MUST work, because this is the internal close price what we see in the Terminal window, in the Price column. This value is everytime the Ask for sell orders, and Bid for buy orders.
I have used this value to check trading limits and not having to think about if it is a Bid or Ask price to check, but not for close orders.Ignored
DislikedDone, v508b, didn't test it
thanks, appreciated.
since version 508, i have large DD this morning. Took too much trades. I need slow itIgnored