Bookmark and Share
Subscribe


Home > C/C++ > EA For MT4 Programmer Required

EA For MT4 Programmer Required

May 14th, 2009

Input Slippage value
Input Trailing stop values , I want to have the option of a special TP function for all (e.g if TP is set to 25 pips then if the profit reached say a target of 15 pips then if the profit starts to decrease then it should stop to say 6 pips profit)
Input Lot Size for A, B & C (ALOT, BLOT & CLOT)
Input values for V1,V2,V3.V11,V22,V33,V111,V222,V333
Input values for VL1,VL2,VL3,VL11,VL22,VL33,VL111,VL222,VL333
Input polarity values for each in win mode AWPOL, BWPOL & CWPOL ¡¥ this is for changing polarity values
Input polarity values for each in loss mode ALPOL, BLPOL & CLPOL ¡¥ this is for changing polarity values
Input value for WINLOT ‘ this where to start the increase of lot in win mode
Input value for LOSSLOT ‘ this where to start the increase of lot in loss mode
Input values for lot size increment in win mode WP1 & WP2
Input values for lot size increment in loss mode LP1 & LP2
Set WIN Counter value WCNTR (1,2,3,¡Ketc)
Set LOSS Counter value LCNTR (1,2,3,¡Ketc)
Set Counter Limit value in win mode WCNTRLIMIT (1,2,3,¡Ketc)
Set Counter Limit value in loss mode LCNTRLIMIT (1,2,3,¡Ketc)
Set A as pending order to Buy or Sell, Input TP1 and SL1 for order A
Set B as pending order to Buy or Sell, Input TP2 and SL2 for order B
Set C as pending order to Buy or Sell, Input TP3 and SL3 for order C
Set On A loss, next A pending order will be flipped or stay ¡¥ flipped means Sell„»Buy or Buy„»Sell
Set On B loss, next B pending order will be flipped or stay ¡¥ flipped means Sell„»Buy or Buy„»Sell
Set On C loss, next C pending order will be flipped or stay ¡¥ flipped means Sell„»Buy or Buy„»Sell
Set On A Win, next A pending order will be flipped or stay ¡¥ flipped means Sell„»Buy or Buy„»Sell
Set On B Win, next B pending order will be flipped or stay ¡¥ flipped means Sell„»Buy or Buy„»Sell
Set On C Win, next C pending order will be flipped or stay ¡¥ flipped means Sell„»Buy or Buy„»Sell

On A Activation then A=A+V1, delete pending orders B & C and place new orders for B & C, B=A+V2 & C=A+V3 with same values of TP & SL as specified for each originally also with the option of reverse or keep the same of each order status to be buy or sell.
On B Activation then B=A+V22, delete pending orders A & C and place new orders for A & C, A=A+V11 & C=A+V33 with same values of TP & SL as specified for each originally also with the option of reverse or keep the same of each order status to be buy or sell.
On C Activation then C=A+V333, delete pending orders A & B and place new orders for A & B, A=A+V111 & B=A+V222 with same values of TP & SL as specified for each originally also with the option of reverse or keep the same of each order status to be buy or sell.

On A, B, C WIN then reset LCOUNTER to “1″ and lot size to return to default value and do the below:

WCNTR=WCNTR+1
If Counter reach its specified limit (WCNTR = WCNTRLIMIT) then WCNTR=1

If WCNTR>1 and On A Activation there are 2 possibilities:
a) If WINLOT>=WCNTR then ALOT= (ALOT*WP1) + WP2, BLOT= (BLOT*WP1) + WP2, CLOT= (CLOT*WP1) + WP2, A=A+(AWPOL*VL1), delete pending orders B & C and place new orders for B & C, B=A+(BWPOL*VL2) & C=A+(CWPOL*VL3)
b) If WINLOT<WCNTR then A=A+(AWPOL*VL1), delete pending orders B & C and place new orders for B & C, B=A+(BWPOL*VL2) & C=A+(CWPOL*VL3)

If WCNTR>1 and On B Activation there are 2 possibilities:
a) If WINLOT>=WCNTR then ALOT= (ALOT*WP1) + WP2, BLOT= (BLOT*WP1) + WP2, CLOT= (CLOT*WP1) + WP2, B=A+(BWPOL*VL22), delete pending orders A & C and place new orders for A & C, A=A+(AWPOL*VL11) & C=A+(CWPOL*VL33)
b) If WINLOT<WCNTR then B=A+(BWPOL*VL22), delete pending orders A & C and place new orders for A & C, A=A+(AWPOL*VL11) & C=A+(CWPOL*VL33)

If WCNTR>1 and On C Activation there are 2 possibilities:
a) If WINLOT>=WCNTR then ALOT= (ALOT*WP1) + WP2, BLOT= (BLOT*WP1) + WP2, CLOT= (CLOT*WP1) + WP2, C=A+(CWPOL*VL333), delete pending orders A & B and place new orders for A & B, A=A+(AWPOL*VL111) & B=A+(BWPOL*VL222)
b) If WINLOT<WCNTR then C=A+(CWPOL*VL333), delete pending orders A & B and place new orders for A & B, A=A+(AWPOL*VL111) & B=A+(BWPOL*VL222)

On A, B, C Loss then reset WCOUNTER to “1″ and lot size to return to default value and do the below:

WCNTR=WCNTR+1
If Counter reach its specified limit (WCNTR = WCNTRLIMIT) then WCNTR=1

If WCNTR>1 and On A Activation there are 2 possibilities:
c) If WINLOT>=WCNTR then ALOT= (ALOT*WP1) + WP2, BLOT= (BLOT*WP1) + WP2, CLOT= (CLOT*WP1) + WP2, A=A+(AWPOL*VL1), delete pending orders B & C and place new orders for B & C, B=A+(BWPOL*VL2) & C=A+(CWPOL*VL3)
d) If WINLOT<WCNTR then A=A+(AWPOL*VL1), delete pending orders B & C and place new orders for B & C, B=A+(BWPOL*VL2) & C=A+(CWPOL*VL3)

If WCNTR>1 and On B Activation there are 2 possibilities:
c) If WINLOT>=WCNTR then ALOT= (ALOT*WP1) + WP2, BLOT= (BLOT*WP1) + WP2, CLOT= (CLOT*WP1) + WP2, B=A+(BWPOL*VL22), delete pending orders A & C and place new orders for A & C, A=A+(AWPOL*VL11) & C=A+(CWPOL*VL33)
d) If WINLOT<WCNTR then B=A+(BWPOL*VL22), delete pending orders A & C and place new orders for A & C, A=A+(AWPOL*VL11) & C=A+(CWPOL*VL33)

If WCNTR>1 and On C Activation there are 2 possibilities:
c) If WINLOT>=WCNTR then ALOT= (ALOT*WP1) + WP2, BLOT= (BLOT*WP1) + WP2, CLOT= (CLOT*WP1) + WP2, C=A+(CWPOL*VL333), delete pending orders A & B and place new orders for A & B, A=A+(AWPOL*VL111) & B=A+(BWPOL*VL222)
d) If WINLOT<WCNTR then C=A+(CWPOL*VL333), delete pending orders A & B and place new orders for A & B, A=A+(AWPOL*VL111) & B=A+(BWPOL*VL222)

Notes:
I want to use this EA multiple times at the same time, hence the following is required:
1) I want to specify an amount of pips achieved for all EA¡¦s (-) or (+) then stop and continue after hh:mm:ss or stop completley until manual activation.
2) I want to instruct, if 2 orders makes a loss at the same time then reset counter (LCNTR=1) for one of them or to a specific one.

Comments

C/C++ , , , ,

Comments are closed.
Bookmark and Share
Subscribe