Can i mention in the void Tick() like
canbuy= "Mycondition"
Cansell= "Mycondition"
?
i dont get it. Where can i put my condition like:
double rsi = iRSI(NULL,0,RSIinput,PRICE_CLOSE,3);
iclose() < RSIinput
Can u give us some more examples please
THX
In CheckOrders(), using Direction() aft4er canBuy and canSell have been initialized at the top.
So it should go like
DashValues[dashKeyForDisplay]=Direction(close>ma, close<ma, canBuy, canSell);
I put ma there because you don't compare the RSI against the price :)
You don't have to use the DashKeys/DashValues dashboard arrays necessarily. The Direction() changes canBuy and canSell flags based on the trading conditions. Those are used later to change the sign for an actual trade.
Like this? Instead of macdfilter?
int openCloseConditionIdx=4;
DashKeys[openCloseConditionIdx-1]="Mode";
DashValues[openCloseConditionIdx-1]="n/a";
int signalConditions=3;
DashKeys[openCloseConditionIdx+1-1]="Signal";
DashValues[openCloseConditionIdx+1-1]=TimeToStr(TimeLocal());
DashKeys[openCloseConditionIdx+2-1]="MyStrategie";
DashValues[openCloseConditionIdx+2-1]="not used";
if(UseMyStrategie)
{
double rsi = iRSI(NULL,0,RSIinput,PRICE_CLOSE,3);
DashValues[openCloseConditionIdx+2-1]=Direction(rsi > RSIBUY,rsi<RSISELL,canBuy,canSell);
}
static bool lastClosedOrderWasLost=false;
static double nextOrderLots=0;
Like this? Instead of macdfilter?
int openCloseConditionIdx=4;
DashKeys[openCloseConditionIdx-1]="Mode";
DashValues[openCloseConditionIdx-1]="n/a";
int signalConditions=3;
DashKeys[openCloseConditionIdx+1-1]="Signal";
DashValues[openCloseConditionIdx+1-1]=TimeToStr(TimeLocal());
DashKeys[openCloseConditionIdx+2-1]="MyStrategie";
DashValues[openCloseConditionIdx+2-1]="not used";
if(UseMyStrategie)
{
double rsi = iRSI(NULL,0,RSIinput,PRICE_CLOSE,3);
DashValues[openCloseConditionIdx+2-1]=Direction(rsi > RSIBUY,rsi<RSISELL,canBuy,canSell);
}
static bool lastClosedOrderWasLost=false;
static double nextOrderLots=0;
Exactly so, this should work. You may notice the Direction function also allows some additional text/string optional parameters to set some additional info on the dashboard for debugging/informational purposes.
THX
Do you know why it is not working with Spots and Indizes?
Post your error here so we can see. Is it lot/volume related?
Thanks for the code... if I had something like that when I started to understand the MQL4... my life wold had been a lot easier!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
MT4 EA Template with all the basic features:
This is a great template to start from if you're looking to build an MT4 EA quick and easily with your own rules/custom indicators. It has all the nice features for managing the account and the trades.
Author: Filip Pop