Jump to content

Recommended Posts

Posted
  ryujin said:
Hi eggzactly,

 

I have insert your codes inside the EA. Just want to check with you if I am correct in the EA variables declaration and the function

 

int pmode;

 

double Pips = TotalProfit(pmode,Magic);

if (Pips >= MinProfit){

CloseAllTrades(0,Magic);

DeletePendingOrders(Magic);

}

 

 

Do I need to put

 

CloseAllTrades(1, Magic);

CloseAllTrades(2, Magic);

 

Since this is declare on top inside the init start()

 

What does CloseAllTrades(1, Magic); , CloseAllTrades(2, Magic); and CloseAllTrades(0, Magic); means?

 

Hi,

 

int pmode; = i put int pmode = 2 ; - for totalpips profit

 

I just use this to close all my trades,

 

// --- Close Orders

int CloseOrders(int magic) {

int numords;

numords = OrdersTotal();

 

for (int cnt = numords - 1; cnt >= 0; cnt--) {

OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);

if (OrderMagicNumber() == magic && OrderSymbol() == Symbol()) {

if (OrderType() == OP_BUY) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage);

if (OrderType() == OP_SELL) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage);

}

}

return (0);

}

 

regards,

 

 

eggzactly

  • Replies 921
  • Created
  • Last Reply

Top Posters In This Topic

Posted

string CableRunStartTime =

string CableRunEndTime =

string CableRunNOTtoTradesTime1 =

string CableRunNOTtoTradesTime2 =

 

can somebody please tell me the correct times for the parameters above for GMT+3 (My localtime) timeframe? I couldn't manage it.

 

Thanks in advance,

 

Metin

Posted
  metin said:
string CableRunStartTime =

string CableRunEndTime =

string CableRunNOTtoTradesTime1 =

string CableRunNOTtoTradesTime2 =

 

can somebody please tell me the correct times for the parameters above for GMT+3 (My localtime) timeframe? I couldn't manage it.

 

Thanks in advance,

 

Metin

 

Check this site, you can learn how to do it for all your EAยดs

 

http://wwp.greenwichmeantime.com/

 

regards,

 

eggzactly

Posted
  eggzactly said:
Check this site, you can learn how to do it for all your EAยดs

 

http://wwp.greenwichmeantime.com/

 

regards,

 

eggzactly

 

Eggzactly, thank you.

I meant I'm confused of the coding shown in the timing strings as below (azam's EA):

 

// Suggested Active 5am until 4pm at GMT +8

string CableRunStartTime = "0:00"; // 1:00=6.00am myfxbook 7am onwards is good !!!!

string CableRunEndTime = "9:30"; // 9:00=2.00pm

string CableRunNOTtoTradesTime1 = "20:00"; //<-- this is your pc local time (=NY 8am)

string CableRunNOTtoTradesTime2 = "01:30"; //(=NY 1.30pm)

 

How come "suggested active 5am= 0:00 and 4pm=9:30" at GMT+8 ; what's the base time to take, broker's server time or local time? I'm really confused...

 

Best regards,

 

Metin

Posted

Global variable for below ... these are fx server time

int EntryHourFrom = 1; // 5am

int EntryHourTo = 13; // 6pm still can trade

int ExitHour = 14; // Stop trade

 

if(!TelagaEmas && !IsTradeTime()) { DeletePendingOrders(Magic); return (0);}

 

The sub.

bool IsTradeTime()

{

bool Result=false;

if((EntryHourFrom<=EntryHourTo && Hour()>=EntryHourFrom && Hour()<=EntryHourTo) ||

(EntryHourFrom>EntryHourTo && (Hour()>=EntryHourFrom || Hour()<=EntryHourTo)))

{

Result=true;

if(Hour()>=ExitHour)

if((EntryHourFrom<=EntryHourTo && ExitHour>=EntryHourFrom) ||

(EntryHourFrom>EntryHourTo && ExitHour>=EntryHourFrom) ||

(EntryHourFrom>EntryHourTo && ExitHour<=EntryHourTo))

Result=false;

}

return(Result);

}

 

 

 

 

 

 

Discard this logic below

 

 

  mrbizu said:
Anyone, please explain me how the EA run with 2 this function

"string CableRunNOTtoTradesTime1 =

string CableRunNOTtoTradesTime2 = " ?

 

Thanks alot

Posted
Hey anyone know about coding EA's? Or tried Profitability EA it runs on m30 on EU and might be a grid kind of design but just seems to enter trades at the wrong time if could mix it with cable run or something might be able to improve it.
Posted

i see your problem that i had before..

just tweak this logic will make the world happy, so you had to be creative & analytical to know what the problem you had, what resources you had to solve it

 

if (Pips >= MinProfit){

while(MyOrdersTotal(Magic) != 0) {

CloseAllTrades(0,Magic);

DeletePendingOrders(Magic);

}

}

 

 

 

  ryujin said:
Hi muruku,

 

I have tried your function

 

double Pips = TotalProfit(Magic);

if (Pips >= MinProfit){

CloseAllTrades(0,Magic);

DeletePendingOrders(Magic);

}

 

which called the function below.

 

int TotalProfit(int Magic)

{

int total=OrdersTotal();

int totalPips = 0;

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

{

OrderSelect(cnt, SELECT_BY_POS);

int mode=OrderType();

bool condition = false;

if (OrderMagicNumber()== Magic)condition = true;

if (condition)

{

switch (mode)

{

case OP_BUY:

totalPips += MathRound((MarketInfo(OrderSymbol(),MODE_BID)-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT));

break;

 

case OP_SELL:

totalPips += MathRound((OrderOpenPrice()-MarketInfo(OrderSymbol(),MODE_ASK))/MarketInfo(OrderSymbol(),MODE_POINT));

break;

}

}

}

return(totalPips);

}

 

I observe my account which is floating more than $30 in profits, but the EA still did not closed all the trades?

 

By the way, my broker is a 5 digit no, hence, I change the value for step and MinProfit to be 170 and 150

 

int Step = 170; // org 17 .. still stick to 17

extern double FirstLot = 0.01; // org 0.10 .. risky .. so just put 0.1

double IncLot = 0.0; // org 0.0

double MinProfit = 150; // org 15

 

Would that be the cause to all orders not closed?

Posted
  muruku said:
Who's got the happy PIPS this week ?

I got 612 ...

 

i am live with cable EA version #171 (azam575) with necessary indicator at #187 (muruku) for around 72hours.

 

manage to get +6.5% profit (default setting, 2 pairs, GU EJ, instaforex cent from USD460 to USD490, now still float +USD11)

 

Hope this EA will be a long term constant profitable EA :)

 

Thank you to muruku (and fellow indo-investasi friends) :)

Posted

i 'm running 24 hrs .. so can this considered all session bot LOL ....

you can look thru all the threads & easily get one...

 

  tongtoro said:
hi muruku

what version do you used?.

Can u share to us?

This bot good on asian market or amerika market?

Thanks

Posted
Hi muruku, I saw there is a buystop, sellstop in coding, does it works?. What is the function of his pending order in coding. Thanks. It seem when all the total floating profit reach MinProfit = 1.5 or 1.5 t/p reach it wont close all the position including the pending order. I'm testing the code by Azam.
Posted
  tgt123 said:
Hi muruku, I saw there is a buystop, sellstop in coding, does it works?. What is the function of his pending order in coding. Thanks. It seem when all the total floating profit reach MinProfit = 1.5 or 1.5 t/p reach it wont close all the position including the pending order. I'm testing the code by Azam.

 

for closing the order.... i`m using other basket close ea :D .....

Posted
  shady2500 said:
and please tell us what is the best time of trading for this ea!!

 

i`m running 24H on 3 pair with FXclering cent account ....

 

running 2 instances on GU with Instafx .... 1 instances trade 24H but avoided london open and 1 instances just traded on asian sleep time :D

 

p/s: sorry for my bad english... not my native language :D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

ร—   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

ร—   Your link has been automatically embedded.   Display as a link instead

ร—   Your previous content has been restored.   Clear editor

ร—   You cannot paste images directly. Upload or insert images from URL.




ร—
ร—
  • Create New...