Forex Zone | Forex Forum

EA Code

Discussion started on EA Modifications

  • Posts: 69
  • Points: 0
  • Likes Received: 4
  • Reputation: +0/-0
EA Code in EA Modifications_xx

thank you for giving me the ea code, hopefully it will be useful ... for more updates
 
#31 - February 11, 2019, 09:23:06 AM

  • EA Code in EA Modifications_index
  • Posts: 1
  • Points: 0
  • Likes Received: 0
  • Reputation: +0/-0
EA Code in EA Modifications_thumbup

thank you very much for help


I don't which section to post this in. Hopefully this is the right one.
I am busy coding an EA (with my limited knowledge ;))
Here is one issue I can't seem to solve, obviously it works perfectly with the EA running on only 1 currency pair, but as soon as I drop it on another pair, I run into the following problems, I know it's just a stupid coding mistake on my side:
-------------------
I have set the maximum trades to 1, so it doesn't open
more than 1 buy or 1 sell.
This works fine, but if I drop the EA on a 2nd pair, it doesn't take trades, unless I change the 2nd MagicNumber to something different.
This is not a real issue, as I can just assign a new magic number to every currency pair. It would just be nice if I don't need 5 different magic numbers for the same EA on 5 pairs

The big issue I have is partial take profit.
It works fine on 1 pair, closes perfectly, BUT if I drop on pair number 2, it uses the 1st next tick to calculate the value the 2nd pair's value, and obviously it uses the wrong pair's value to partly close the other pair.


Code: [Select]
//  add your notes here ...
if ( ( Use_Partial_TP == true ))
{
SellPTP=OrderOpenPrice()-(Partial_TP* Point);
if ( ( OrderLots() == Lots ) || ( OrderLots() == _MMLots ))
{
if ( ( Ask <= SellPTP ))
{
for( int pos6030=0;pos6030<OrdersTotal();pos6030++)
{
if(OrderSelect(pos6030,SELECT_BY_POS)==false) continue;
if( ( OrderTicket() == _OrderTicketEA) )
{
double price6198=0;

price6198 = MarketInfo(OrderSymbol(), MODE_ASK);

_fnCloseSellPTP = OrderClose(  OrderTicket(), (OrderLots()/2), price6198, Slippage, White );
if( _fnCloseSellPTP == false )
Print("OrderClose error=", GetLastError());


Coding for buy is basically the same except Add to the open price, and close price is Bid, etc etc.
And it does this besides the fact that the same EA runs on both pairs, but different magic numbers, which is why I am totally stumped, I was under the impression if I assign different magics, it will solve this problem too.

Thanks for the help again.
Francois


#32 - February 11, 2019, 05:26:20 PM

  • EA Code in EA Modifications_index
  • Posts: 742
  • Points: 338
  • Likes Received: 55
  • Reputation: +3/-6
EA Code in EA Modifications_xx
if you do not use the magic number on EA means that EA must read the symbol pair that is being traded this is used so that the reading of all orders can be separated from one pair to another
#33 - February 12, 2019, 12:52:01 PM

  • EA Code in EA Modifications_Avril_Lavigne
  • Posts: 424
  • Points: 18
  • Likes Received: 39
  • Reputation: +0/-0
EA Code in EA Modifications_xx
if you do not use the magic number on EA means that EA must read the symbol pair that is being traded this is used so that the reading of all orders can be separated from one pair to another
whether EA can also read all the symbols so that the results can be added together and from the total results if it is positive, it can close all
#34 - April 24, 2019, 02:36:47 AM

  • EA Code in EA Modifications_index
  • Posts: 742
  • Points: 338
  • Likes Received: 55
  • Reputation: +3/-6
EA Code in EA Modifications_xx
whether EA can also read all the symbols so that the results can be added together and from the total results if it is positive, it can close all
can be contrived as you wish, but all that must be seen in full coding
#35 - April 24, 2019, 11:47:43 PM

  • Posts: 47
  • Points: 0
  • Likes Received: 0
  • Reputation: +0/-0
EA Code in EA Modifications_xx
can be contrived as you wish, but all that must be seen in full coding
has it become EA
#36 - June 20, 2019, 05:45:10 AM

  • EA Code in EA Modifications_index
  • Posts: 742
  • Points: 338
  • Likes Received: 55
  • Reputation: +3/-6
EA Code in EA Modifications_xx
#37 - June 21, 2019, 02:33:20 AM

  • Posts: 47
  • Points: 0
  • Likes Received: 0
  • Reputation: +0/-0
EA Code in EA Modifications_xx
NOT YET
if so, let's wait together here
#38 - June 28, 2019, 03:28:06 PM

  • EA Code in EA Modifications_index
  • Posts: 742
  • Points: 338
  • Likes Received: 55
  • Reputation: +3/-6
EA Code in EA Modifications_xx
if so, let's wait together here
yes, be patient
#39 - July 02, 2019, 11:01:29 AM

  • Posts: 36
  • Points: 0
  • Likes Received: 0
  • Reputation: +0/-0
EA Code in EA Modifications_xx
yes, be patient
hope you will be patient
#40 - July 04, 2019, 08:41:34 AM

  • Posts: 47
  • Points: 0
  • Likes Received: 0
  • Reputation: +0/-0
EA Code in EA Modifications_xx
yes, be patient
what if you try it yourself
#41 - July 04, 2019, 01:05:19 PM

  • Posts: 10
  • Points: 0
  • Likes Received: 0
  • Reputation: +0/-0
EA Code in EA Modifications_xx
can you help me..make an ea?
#42 - August 12, 2019, 06:25:31 AM

Members:

0 Members and 1 Guest are viewing this topic.


* Similar Topics

xx
need code done mq4

Started by rgmorris on EA Modifications

13 Replies
1000 Views
Last post June 26, 2019, 07:35:58 AM
by zahro
clip
NEED HELP TO CODE NEW INDICATOR

Started by Gutis on New Indicator Coding

2 Replies
886 Views
Last post July 05, 2019, 09:05:41 AM
by urip
xx
CODE EXISTING EA

Started by milo1969 on New EA Coding

19 Replies
1586 Views
Last post July 25, 2019, 08:25:10 AM
by gawe
xx
Please help me code a basic 60-second strategy

Started by rcmenriquez on New EA Coding

2 Replies
1238 Views
Last post June 28, 2018, 01:08:05 PM
by rcmenriquez