SmartAss shows very nice profit on my backtest (GBPUSD, 1H, starting 2015-8-20), however, I never see a buy trade, even when moving the start date to avoid sell trades. Is that by design or just a kink in the EA?
uli43: SmartAss shows very nice profit on my backtest (GBPUSD, 1H, starting 2015-8-20), however, I never see a buy trade, even when moving the start date to avoid sell trades. Is that by design or just a kink in the EA?
/*
int SmartAss() //--function: Check trend and calculation order.
{
etc....
*/for(x=0;x<3;x++)
{
if(iOsMA(symbol,TFX[x],12,26,9,6,0)>iOsMA(symbol,TFX[x],12,26,9,6,1))
{osb++;}
if(iOsMA(symbol,TFX[x],12,26,9,6,0)<iOsMA(symbol,TFX[x],12,26,9,6,1))
{oss++;}
//--if(iMA(symbol,TFX[x],20,0,0,0,0)>iMA(symbol,TFX[x],20,0,0,1,0))
{upm++;}
else {dnm++;}
}
//--if (osb==3 && upm>=2) {Upward=true;}
if (oss==3 && dnm>=2) {Upward=false;}
//------ try changing the code above, like this: (I hope that the result may be changed or different)for(x=0;x<3;x++)
{
if(iOsMA(symbol,TFX[x],12,26,9,6,0)>iOsMA(symbol,TFX[x],12,26,9,6,1))
{osb++;}
elseif(iOsMA(symbol,TFX[x],12,26,9,6,0)<iOsMA(symbol,TFX[x],12,26,9,6,1))
{oss++;}
//--if(iMA(symbol,TFX[x],20,0,0,0,0)>iMA(symbol,TFX[x],20,0,0,1,0))
{upm++;}
elseif(iMA(symbol,TFX[x],20,0,0,0,0)<iMA(symbol,TFX[x],20,0,0,1,0))
{dnm++;}
}
//--if (osb==3 && upm>=2) {Upward=true;}
elseif (oss==3 && dnm>=2) {Upward=false;}
/*
etc...
*/
Hi: I went through the code, it seems the problem is the variable Upward - it is initialised to false and stays that way regardless of oss and osb etc. However, even with the fix, oss and osb never get to 3 as required, so no trade ever.
My attempt to fix the problem:
int SmartAss() //--function: Check trend and calculation order.
{
//----
SignalBuy=false;
SignalSell=false;
bool FlgUpward = false; // add this variable
bool Upward;
bool OrHdg;
int upm,dnm;
int osb,oss,x;
ResetLastError();
RefreshRates();
//--
for(x=0;x<3;x++)
{
if (iOsMA(symbol,TFX[x],12,26,9,6,0)>iOsMA(symbol,TFX[x],12,26,9,6,1))
{osb++;}
if (iOsMA(symbol,TFX[x],12,26,9,6,0)<iOsMA(symbol,TFX[x],12,26,9,6,1))
{oss++;}
//--
if (iMA(symbol,TFX[x],20,0,0,0,0)>iMA(symbol,TFX[x],20,0,0,1,0))
{upm++;}
else {dnm++;}
}
//--
if (osb==3 && upm>=2)
{
Upward=true;
FlgUpward = true; // change here
}
if (oss==3 && dnm>=2)
{
Upward=false;
FlgUpward = true; // change here
}
if (FlgUpward == false);
{return(0);} // return if FlgUpward has not flipped
Hi: I went through the code, it seems the problem is the variable Upward - it is initialised to false and stays that way regardless of oss and osb etc. However, even with the fix, oss and osb never get to 3 as required, so no trade ever.
My attempt to fix the problem:
int SmartAss() //--function: Check trend and calculation order.
{
//----
SignalBuy=false;
SignalSell=false;
bool FlgUpward = false; // add this variable
bool Upward;
bool OrHdg;
int upm,dnm;
int osb,oss,x;
ResetLastError();
RefreshRates();
//--
for(x=0;x<3;x++)
{
if (iOsMA(symbol,TFX[x],12,26,9,6,0)>iOsMA(symbol,TFX[x],12,26,9,6,1))
{osb++;}
if (iOsMA(symbol,TFX[x],12,26,9,6,0)<iOsMA(symbol,TFX[x],12,26,9,6,1))
{oss++;}
//--
if (iMA(symbol,TFX[x],20,0,0,0,0)>iMA(symbol,TFX[x],20,0,0,1,0))
{upm++;}
else {dnm++;}
}
//--
if (osb==3 && upm>=2)
{
Upward=true;
FlgUpward = true; // change here
}
if (oss==3 && dnm>=2)
{
Upward=false;
FlgUpward = true; // change here
}
if (FlgUpward == false);
{return(0);} // return if FlgUpward has not flipped
//--
Youdo notfullyfollow thecodeI gavethe exampleabove,ifandelse if Youmayalsomake a2boolvariable:upwardanddnward;
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
which link can I download this expert advisor please.
thanks
Hi piusato1,
On this page: https://www.mql5.com/en/code/11137
I am interested in SAT3 too and would appreciate a download link!
But I do have another question about SmartAss.
From the code I read that your trading window is every working day 00:00 - 00:16:
But what is the the time-zone of 00:00 - 00:16 or what is your GMT-Offset?
Doesn't it matter?
Thanks, calli
I used SAT3 and smartasstrade-v2, I see SAT3 better. But my computer has been reinstall window, so I lost file SAT3 ea.
Please send it to me via messages ! Thank you very much !
I am interested in SAT3 too and would appreciate a download link!
But I do have another question about SmartAss.
From the code I read that your trading window is every working day 00:00 - 00:16:
But what is the the time-zone of 00:00 - 00:16 or what is your GMT-Offset?
Doesn't it matter?
Thanks, calli
SmartAss shows very nice profit on my backtest (GBPUSD, 1H, starting 2015-8-20), however, I never see a buy trade, even when moving the start date to avoid sell trades. Is that by design or just a kink in the EA?
Hi: I went through the code, it seems the problem is the variable Upward - it is initialised to false and stays that way regardless of oss and osb etc. However, even with the fix, oss and osb never get to 3 as required, so no trade ever.
My attempt to fix the problem:
int SmartAss() //--function: Check trend and calculation order.
{
//----
SignalBuy=false;
SignalSell=false;
bool FlgUpward = false; // add this variable
bool Upward;
bool OrHdg;
int upm,dnm;
int osb,oss,x;
ResetLastError();
RefreshRates();
//--
for(x=0;x<3;x++)
{
if (iOsMA(symbol,TFX[x],12,26,9,6,0)>iOsMA(symbol,TFX[x],12,26,9,6,1))
{osb++;}
if (iOsMA(symbol,TFX[x],12,26,9,6,0)<iOsMA(symbol,TFX[x],12,26,9,6,1))
{oss++;}
//--
if (iMA(symbol,TFX[x],20,0,0,0,0)>iMA(symbol,TFX[x],20,0,0,1,0))
{upm++;}
else {dnm++;}
}
//--
if (osb==3 && upm>=2)
{
Upward=true;
FlgUpward = true; // change here
}
if (oss==3 && dnm>=2)
{
Upward=false;
FlgUpward = true; // change here
}
if (FlgUpward == false);
{return(0);} // return if FlgUpward has not flipped
//--
Hi: I went through the code, it seems the problem is the variable Upward - it is initialised to false and stays that way regardless of oss and osb etc. However, even with the fix, oss and osb never get to 3 as required, so no trade ever.
My attempt to fix the problem:
int SmartAss() //--function: Check trend and calculation order.
{
//----
SignalBuy=false;
SignalSell=false;
bool FlgUpward = false; // add this variable
bool Upward;
bool OrHdg;
int upm,dnm;
int osb,oss,x;
ResetLastError();
RefreshRates();
//--
for(x=0;x<3;x++)
{
if (iOsMA(symbol,TFX[x],12,26,9,6,0)>iOsMA(symbol,TFX[x],12,26,9,6,1))
{osb++;}
if (iOsMA(symbol,TFX[x],12,26,9,6,0)<iOsMA(symbol,TFX[x],12,26,9,6,1))
{oss++;}
//--
if (iMA(symbol,TFX[x],20,0,0,0,0)>iMA(symbol,TFX[x],20,0,0,1,0))
{upm++;}
else {dnm++;}
}
//--
if (osb==3 && upm>=2)
{
Upward=true;
FlgUpward = true; // change here
}
if (oss==3 && dnm>=2)
{
Upward=false;
FlgUpward = true; // change here
}
if (FlgUpward == false);
{return(0);} // return if FlgUpward has not flipped
//--
You may also make a 2 bool variable: upward and dnward;