I have a rather simple EA that I need to tweak. There are two questions that I have.
1) What piece of code do I need so that I only have one position open per currency pair.
for example. The program that I'm using right now seems to open more than one position and then close it too quick, so multiple lots are opened and closed before a final position stays. This leaves me with several -4 to -6 pip lots that add up. The program is supposed to only open one lot at the close of a 1 hr candle, and only close the position at the close of a bar also.
2) Can I used the following code to make my positions open a trade with 3% of my account value: Here I have set the lot number to equal the MaximumRisk of 3%. Is this legal?
Also, should the EachTickMode be set to true or false if I only want the trades to open or close at the end of candles?
extern int MagicNumber = 12345;
extern bool SignalMail = False;
extern bool EachTickMode = False;
extern double MaximumRisk =0.030;
extern string Lots = MaximumRisk;
extern int Slippage = 3;
Thanks in advance while I learn to code this language from the ground up.
1) What piece of code do I need so that I only have one position open per currency pair.
for example. The program that I'm using right now seems to open more than one position and then close it too quick, so multiple lots are opened and closed before a final position stays. This leaves me with several -4 to -6 pip lots that add up. The program is supposed to only open one lot at the close of a 1 hr candle, and only close the position at the close of a bar also.
2) Can I used the following code to make my positions open a trade with 3% of my account value: Here I have set the lot number to equal the MaximumRisk of 3%. Is this legal?
Also, should the EachTickMode be set to true or false if I only want the trades to open or close at the end of candles?
extern int MagicNumber = 12345;
extern bool SignalMail = False;
extern bool EachTickMode = False;
extern double MaximumRisk =0.030;
extern string Lots = MaximumRisk;
extern int Slippage = 3;
Thanks in advance while I learn to code this language from the ground up.
"60% of the time it works...every time"