Trading GBPJPY on live .01 account. Standard settings with diff start/stop times.
regards
Stormin
When you have been around here for a while you will come to understand that I create my EA's from code shells.stormin » Tue Nov 01, 2016 7:41 pm wrote: really dont know if the different times have much affect as once its trading it does its thing. Possibly the initial kickoff when no hedge set or not adding new trades on those closes.
Hi guys,moebiusx » Tue Nov 01, 2016 9:15 am wrote:Thanks to Tomele and Steve for this amazing Ea
Hi guys,
maybe my think is wrong but i dont see the creation of the full hedge trade (i have set the option at 5)
-BuyAndSellUnbalancedAt
Thanks to Tomele and Steve for this fantastic EAmoebiusx » Wed Nov 02, 2016 7:06 am wrote:
Hi guys,
now the full hedge trade is created but seems to work only with:
-BuyAndSellUnbalancedAt >=10
(my setting is always = 5)
Code: Select all
//I added HTF as an afterthought, so these variables are for TradingTimeFrame
double Curr1Val[3];//For shifts 0 to 2
string SsColour[3];//For shifts 0 to 2. Colours defined at top of file
string SsCrossStatus="";//ssnocross, sslongcross or ssshortcross defined above
//Variables for HigherTimeFrame
double HtfCurr1Val;
string HtfSsColour="";
//Variables for MediumTimeFrame
double MtfCurr1Val;
string MtfSsColour="";
//Variables for SuperSlope
bool BrokerHasSundayCandles;Code: Select all
text = "SuperSlope trading time frame currency strengths: ";
for (cc = 2; cc >= 0; cc--)
{
text = text + DoubleToStr(Curr1Val[cc], 4) + ": ";
}//for (cc = 2; cc >= 0; cc--)
SM(text + NL);
//text = "Second trading time frame currency strengths: ";
//for (cc = 2; cc >= 0; cc--)
//{
// text = text + DoubleToStr(Curr2Val[cc], 4) + ": ";
//}//for (cc = 2; cc >= 0; cc--)
//SM(text + NL);Code: Select all
//if (!indiExists( "Baluda.SuperSlope.v.2.0 for EA" ))
//{
// Alert("");
// Alert("Download the indi from Bob's HGI thread and adit the HGI_Name input");
// Alert("The required indicator Baluda.SuperSlope.v.2.0 for EA does not exist on your platform. I am removing myself from your chart.");
// RemoveExpert = true;
// ExpertRemove();
// return(0);
//}//if (! indiExists( "IndiName" ))Code: Select all
BrokerHasSundayCandles = false;
for ( int i = 0; i < 8; i++ )
{
if ( TimeDayOfWeek( iTime( NULL, PERIOD_D1, i ) ) == 0 )
{
BrokerHasSundayCandles = true;
break;
}
}
//Call sq's show trades indi
//iCustom(NULL, 0, "SQ_showTrades",Magic, 0,0);Code: Select all
//+------------------------------------------------------------------+
//| GetSuperSlope() |
//+------------------------------------------------------------------+
double GetSuperSlope( int tf, int maperiod, int atrperiod, int pShift )
{
double dblTma, dblPrev;
int shiftWithoutSunday = pShift;
if ( BrokerHasSundayCandles && PERIOD_CURRENT == PERIOD_D1 )
{
if ( TimeDayOfWeek( iTime( NULL, PERIOD_D1, pShift ) ) == 0 ) shiftWithoutSunday++;
}
double atr = iATR( NULL, tf, atrperiod, shiftWithoutSunday + 10 ) / 10;
double result = 0.0;
if ( atr != 0 )
{
dblTma = iMA( NULL, tf, maperiod, 0, MODE_LWMA, PRICE_CLOSE, shiftWithoutSunday );
dblPrev = ( iMA( NULL, tf, maperiod, 0, MODE_LWMA, PRICE_CLOSE, shiftWithoutSunday + 1 ) * 231 + iClose( NULL, tf, shiftWithoutSunday ) * 20 ) / 251;
result = ( dblTma - dblPrev ) / atr;
}
return ( result );
}//GetSuperSlope()Code: Select all
///////////////////////////////////////
//Indi reading code goes here.
if (!UseHGI || TrendTimeFrameStatus == hginotrend)
{
//HTF SS
//Read at the open of each new LtfTimeFrame in case it has changed colour
if (UseHigherTimeFrameControl)
{
//Buffer 0 holds first currency in the pair
HtfCurr1Val = GetSuperSlope(HigherTimeFrame,HtfSlopeMAPeriod,HtfSlopeATRPeriod,0);
//What colour is the histo:
MtfSsColour = red;
if (MtfCurr1Val > 0)
MtfSsColour = green;
}//if (UseHigherTimeFrameControl)
//MTF SS
//Read at the open of each new LtfTimeFrame in case it has changed colour
if (UseMediumTimeFrameControl)
{
//Buffer 0 holds first currency in the pair
MtfCurr1Val = GetSuperSlope(MediumTimeFrame,MtfSlopeMAPeriod,MtfSlopeATRPeriod,0);
//What colour is the histo:
MtfSsColour = red;
if (MtfCurr1Val > 0)
MtfSsColour = green;
}//if (UseMediumTimeFrameControl)
LongTradeTrigger = false;
ShortTradeTrigger = false;
LtfTimeFrameStatus = hginosignal;
//Read SuperSlope
for (cc = 2; cc >= 0; cc--)
{
//Buffer 0 holds first currency in the pair
Curr1Val[cc] = GetSuperSlope(LtfTimeFrame,LtfSlopeMAPeriod,LtfSlopeATRPeriod,cc);
//Set the colours
SsColour[cc] = red;
if (Curr1Val[cc] > 0)
SsColour[cc] = green;
}//for (cc = 2; cc >= 0; cc--)
//The cross status
SsCrossStatus = ssnocross;
//Longcross
if (SsColour[2] == red)
if (SsColour[1] == green)
if (SsColour[0] == green)
{
SsCrossStatus = sslongcross;
LongTradeTrigger = true;
}//if (SsColour[0] == green)
//Short cross
if (SsColour[2] == green)
if (SsColour[1] == red)
if (SsColour[0] == red)
{
SsCrossStatus = ssshortcross;
ShortTradeTrigger = true;
}//if (SsColour[0] == red)
}//if (UseHGI || TrendTimeFrameStatus == hginotrend)