How to code? - page 229

 
 

Simple profitable system needs EA programmer!!!!!

Hi community,

Since I'm not allowed to open a new thread here, I have to post this profitable strategy with the POST REPLY button to this forum to ask any

programmer to do an EA for this system

Would be fine if someone could do an EA from the indicator with the rules as follows

I trade in a H4 timeframe (ANY volitable currency will do!!!!)

If line was green (uptrend) now going red (downtrend)

==> Close buy-order (if still open)

==> Sell with Stoploss from last candles high +10/20 Pips

if line was red (downtrend) now going green (uptrend)

==> Close sell-order (if still open)

==> Buy with Stoploss from last candles low -10/20 Pips

I take my signal ONLY after completion of the current candle!!!

(because the line changes color several times before the current candle is complete)

After sending my order (sell or buy) I wait for the next candle to close THEN I set my Stoploss to Breakeven and let the trade go on until the trend

reverses (the order is closed automatically by rules - see above) or if I see it suits my profit target I close the order manually and take my

profit...

You could set a Takeprofit of let's say 50 to 100 pips (depends on currency) or a Trailing if you would not let the trade close to breakeven...

Hope this helps anyone in doing an EA for this profitable system...!?!? It would be great if this strategy could run on autopilot (EA) when I'm at

work, so it would take more pips out of the market...Thanks

Kevin Flynn

As the attachment seems to be too big to be placed here, here is the download link to the komplett System including templates, indicators and image of rules with stoploss, etc. (just copy download link to your browser and replace hxxp to http !!!)

hxxp://remixshare.com/dl/p6pdb/LineOfDestiny komplett.zip

 

IndexArrow trigged ObjectArrow

Hello!

Im a newbies and ask help with that Problem:

I need that if SetIndexArrow() trigged so also must

ObjectCreate(),ObjectSet()!

Is it possible??

Regards.

Rolf

27.03.2010

 

Horizontal Lines

Hi

I am looking for an indicator which draw lines with user input xInterval around current price

For example shown in picture current price is 1.3414 and intervel is 10 pips so upper line should @ 1.3420 & 1.3430, and downline should be @ 1.3410 & 1.3400

and if we input 20 pips the line should be @ 1.3430 & 1.3450, down line @ 1.3400 & 1.3380

simple piece of code that will show the logic how to do that will be good

Thanks

Arshed.

Files:
 

I need help about afl to mql4!!! please help to me

I need to mql4 formulas from this afl code!!! Please help me

_SECTION_BEGIN("Earth-2");

VAR2=(High+Low+(Close)*(2))/(4);

B = ((EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))*(38));

Plot(b, "", 4, 1+4);

bot1 = ((((-1))*(EMA((VAR2-LLV(VAR2,15))/(HHV(Low,15)-LLV(VAR2,15)),2))+0.01)*(38));

Plot(bot1, "", 4, 1+4);

VAR22=((Close-LLV(Low,10))/(HHV(High,10)-LLV(Low,10)))*(100);

VAR33=EMA(VAR22,10);

VAR44=EMA(VAR33,10);

VAR55=(3)*(VAR33)-(2)*(VAR44);

VAR66=EMA(VAR55,5);

BridgeT = (EMA(VAR66,1));

Plot(bridget, "", IIf(bridget > Ref(bridget,-1),colorYellow,colorBlue), 1+4);

Plot(-bridget, "", IIf(bridget > Ref(bridget,-1),colorYellow,colorBlue), 1+4);

trend = (5)*(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5))-

(3)*(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3))-

EMA(EMA(EMA(((Close-LLV(Low,27))/(HHV(High,27)-LLV(Low,27)))*(100),5),3),2);

Buy1 = Cross(trend,5);

PlotShapes( IIf( Buy1, shapeSmallSquare, shapeNone ), colorGreen, layer = 0, yposition = 0, offset = 3 );

PlotShapes( IIf( Buy1, shapeSmallSquare, shapeNone ),colorGreen, layer = 0, yposition = 0, offset = -4 );

VARA1=((Close>=Ref(Close,-1)) AND (Ref(Close,-1)>=Ref(Close,-2)) AND (Ref(Close,-1)<=Ref(Close,-3))

AND (Ref(Close,-2)Ref(Close,-2)) OR (Ref(Close,-4)<=Ref(Close,-2))

AND (Ref(Close,-5)>=Ref(Close,-3))) OR (Close>=Ref(Close,-1)) AND (Ref(Close,-1)<=Ref(Close,-2))

AND (Close>=Ref(Close,-2)) AND ((Ref(Close,-3)>Ref(Close,-1)) OR (Ref(Close,-3)<=Ref(Close,-1))

AND (Ref(Close,-4)>=Ref(Close,-2))));

VARA2=LLV(Low,5);

VARA3=HHV(High,5);

VARA4=EMA(((Close-VARA2)/(VARA3-VARA2))*(100),4);

VARA5=EMA((0.66699999)*(Ref(VARA4,-1))+(0.333)*(VARA4),2);

VARA6=(VARA5<24) AND (Open<MA(Close,20));

Buy2 =IIf(VARA1 AND (VARA6),30,0);

Plot(Buy2, "", 8,2+4);

Plot(-Buy2, "", 8,2+4);

_N(Title = StrFormat("\\c02.{{NAME}} | {{DATE}} | {{VALUES}}")+EncodeColor(colorBrightGreen)+WriteIf(Buy2==30,"BuySignal-A","" )+EncodeColor(colorBrightGreen)+WriteIf(Buy1==1," | BuySignal-B",""));

_SECTION_BEGIN("Earth-3");

n = Param("Periods", 14, 5, 25, 1 );

var6=(2*Close+High+Low)/4;

var7=LLV(L,n);

var8=HHV(H,n);

var9=EMA((var6-var7)/(var8-var7)*100,5);

varA=EMA(0.333*Ref(var9,-1)+0.667*var9,3);

UP=Var9;

DOWN=Vara;

barcolor2=

IIf( (Ref(up,-1)>Ref(down,-1) AND Ref(up,-1)>up AND up>down )

OR (Ref(up,-1)<Ref(down,-1) AND Ref(up,-1)<up AND up<down )

, colorBlue,

IIf(up>down,5,4));

Plot(0,"",barcolor2,styleLine);

_SECTION_END();

_SECTION_BEGIN("Earth-1");

EB1 = Close > Ref(Close, -1) AND Ref(Close, -1) > Ref(Close, -2) AND Ref(Close, -1) < Ref(Close, -3) AND IIf(Ref(Close, -3) < Ref(Close, -4), 1, IIf(Ref(Close, -4) < Ref(Close, -5),Ref(Close, -1) < Ref(Close, -4) OR( Ref(Close, -2) = Ref(Close, -5) ),IIf(Ref(Close, -5) < Ref(Close, -6), 1,Ref(Close, -6) < Ref(Close, -7))));

ES1 = Close < Ref(Close, -1) AND Ref(Close, -1) Ref(Close, -3) AND IIf(Ref(Close, -3) > Ref(Close, -4), 1, IIf(Ref(Close, -4) > Ref(Close, -5),Ref(Close, -1) > Ref(Close, -4) OR( Ref(Close, -2) > Ref(Close, -4) AND Ref(Close, -3) Ref(Close, -6), 1,Ref(Close, -6) > Ref(Close, -7))));

PlotShapes( IIf( ES1, shapeHollowSmallSquare, shapeNone ), colorOrange, layer = 0, 0, 0 );

PlotShapes( IIf( EB1, shapeUpArrow, shapeNone ), colorBlack, layer = 0, 0, 0 );

_SECTION_END();

_SECTION_BEGIN("Exploration");

LastBar = Cum( 1 ) == LastValue( Cum( 1 ) );

Filter = LastBar;

pfrom = Param("Price From", 0, 0, 1000, 0.5 );

pto = Param("Price To", 1000, 0, 1000, 0.5 );

Minv = Param("Minimum Volume (K)", 500, 0, 1000, 50);

dd = Param("Decimal Digits", 1.2, 1, 1.7, 0.1 );

EB21= Buy1;

EB22=Buy2;

//Filter = Buy AND C>pfrom AND C1000*Minv;

Color = IIf(Close>Open, colorGreen, colorRed);

bcolor = IIf(Buy1 OR Buy2, colorGreen, 1);

AddTextColumn(WriteIf(EB1,"Buy",WriteIf(ES1,"Sell","")),"Earth-1",colorDefault,-1);

AddTextColumn(WriteIf(Buy1==1,"Buy-A"," "),"Earth-2a",colorDefault,-1);

AddTextColumn(WriteIf(Buy2==30,"Buy-B"," "),"Earth-2b",colorDefault,-1);

AddTextColumn(WriteIf(bridget > Ref(bridget,-1) AND Ref(bridget,-1)<Ref(bridget,-2),"Buy",WriteIf(bridget Ref(bridget,-2),"Sell","")),"Earth-2c",colorDefault,-1);

AddTextColumn(WriteIf(barcolor2==colorBlue,"Modarate",WriteIf(barcolor2==4,"Buy",WriteIf(barcolor2==5,"Sell",""))),"Earth-3",colorDefault,-1);

//AddColumn(Buy, "Buy" , 1.1, bcolor);

//AddColumn(O, "Open", dd, textColor = Color);

//AddColumn(C, "Close", dd, textColor = Color);

//AddColumn(V, "Volume", 1, textColor = Color);

//AddTextColumn(FullName(),"Name");

 

Hello,

You may have to pay someone to code that, it will take me months just to figure out what its doing and I dont have time for that. Sure does make some pretty pictures though.

Seeing as it uses Volume, I would be careful using MT4 broker volume as they differ greatly between brokers.

Good luck with that.

Swagman

 

wrong parameter count

why is this code giving the wrong parameter count error:

for(int i = 0;i < 3;i++)

{

kline = iStochastic(NULL,TimeFrame1, Period(), 4, 3, 3, MODE_SMA, 1, MODE_MAIN, i);

dline = iStochastic(NULL,TimeFrame1, Period(), 4, 3, 3, MODE_SMA, 1, MODE_SIGNAL, i);

}

 

TimeFrame = Period() = Extra Parameter

forextrend:
why is this code giving the wrong parameter count error:

for(int i = 0;i < 3;i++)

{

kline = iStochastic(NULL,TimeFrame1, Period(), 4, 3, 3, MODE_SMA, 1, MODE_MAIN, i);

dline = iStochastic(NULL,TimeFrame1, Period(), 4, 3, 3, MODE_SMA, 1, MODE_SIGNAL, i);

}

Hi Forextrend,

The problem may be with TimeFrame1 and Period() - they set the TF for the indicator.

The iStochastic can use either one, but not both?

Try remove one or the other - That may be the 'extra' parameter.

Hope this helps,

Robert

 
forextrend:
why is this code giving the wrong parameter count error:

for(int i = 0;i < 3;i++)

{

kline = iStochastic(NULL,TimeFrame1, Period(), 4, 3, 3, MODE_SMA, 1, MODE_MAIN, i);

dline = iStochastic(NULL,TimeFrame1, Period(), 4, 3, 3, MODE_SMA, 1, MODE_SIGNAL, i);

}

Try this:

iStochastic( Symbol(), 0, StochK, StochD, StochSlowing, MODE_SMA, 0, MODE_MAIN, 0 );

  • Symbol() is for which currency pair you want to calculate
  • 0 is for timeframe (current here)
  • then there are K/D/Slowing params
  • MODE_SMA - just MA mode
  • 0 - field param (hi/lo or close/close)
  • MODE_MAIN is Selection of main stoch line (instead of signal one)
  • 0 - means current candle

You entered iStochastic( ..., Period(), 4, 3, 3 ) which is probably the source of problem. All other params are ok, just you seem to have too many parameters here.

 

Halp!!!!!!!!!!

I have tried just about every possible combo of the cursed freaking parenthesis fault that i am getting trying to compile. Been looking at it for many hours but no luck in fixing it. I have nailed it down to a section of code whats screwing the script up. Anyone advise me on whats wrong (aside from me being a moron).

void ScanForClosure ()

{

int cash = OrderProfit() + OrderSwap() + OrderCommission()

int MacdCurrent, MacdPrevious, SignalCurrent;

int SignalPrevious, MaCurrent, MaPrevious;

int total2 = OrdersTotal();

int numords2 = 0;

bool type = false;

int trd2 = 0;

MacdCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,0);

MacdPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,1);

SignalCurrent=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,0);

SignalPrevious=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,1);

MaCurrent=iMA(NULL,0,MATrendPeriod,0,MODE_EMA,PRICE_CLOSE,0);

MaPrevious=iMA(NULL,0,MATrendPeriod,0,MODE_EMA,PRICE_CLOSE,1);

ArrayResize(lastOrders,5);

ArrayInitialize(lastOrders,0);

//

for(int cnt=0; cnt<total2; cnt++)

{

OrderSelect(cnt, SELECT_BY_POS);

if (OrderSymbol() == Symbol() && OrderMagicNumber() == Magic) ;

{

if ((OrderType()==OP_BUY)&&

(MacdCurrent>0)&&

(MacdCurrent<SignalCurrent)&&

(cash > 0)&&

(MacdPrevious>SignalPrevious) && MacdCurrent>(MACDCloseLevel*Point));

{

CloseOrder(1);

}

if ((OrderType()==OP_SELL)&&

(cash > 0)&& (MacdCurrent<0 ) &&

(MacdCurrent>SignalCurrent)&&

(MacdPrevious<SignalPrevious)&&

(MathAbs(MacdCurrent))>(MACDCloseLevel*Point));

{

CloseOrder(2);

}

}

}

}