FxPro Quant - Page 2

1. Newbie
Join Date
Apr 2016
Posts
1
Dear Supporter,

I Want to program an EA with a function: When a fast MA cross the slow MA in upward direction, AND some other conditions are fulfiled, the EA opens a long position, but only one. No other long positions will be opened (even when all the conditions are fulfiled again), UNTIL the fast MA cross the slow MA in upward direction AGAIN.

So (as I think) I need some kind of "true/false register", wich turns to false when the first position (in the direction) opened, AND remain false after the first position closed, until the MA's crosses again. Set condition is the opened position, re-set condition is the MA cross.

I try the true/false variable, but I can't connect separate set and re-set conditions.

Would You be so kind to tell me a solution fro the problem?

Many theanks, regards

2. Originally Posted by herp
Dear Supporter,

I Want to program an EA with a function: When a fast MA cross the slow MA in upward direction, AND some other conditions are fulfiled, the EA opens a long position, but only one. No other long positions will be opened (even when all the conditions are fulfiled again), UNTIL the fast MA cross the slow MA in upward direction AGAIN.

So (as I think) I need some kind of "true/false register", wich turns to false when the first position (in the direction) opened, AND remain false after the first position closed, until the MA's crosses again. Set condition is the opened position, re-set condition is the MA cross.

I try the true/false variable, but I can't connect separate set and re-set conditions.

Would You be so kind to tell me a solution fro the problem?

Many theanks, regards
Dear herp,

Usually strategies like this require using variables to store some values between ticks.
However, in this particular case you can avoid it. Your strategy can be implemented with the following rules:

1. MA Fast [2] < MA Slow [2]
2. MA Fast [1] >= MA Slow [1]
3. New bar

In square brackets candle index is shown. 0 - means current candle, 1 - previous candle, etc.
This way your position will be opened only when crossover happened on the first tick of the next candle. And new position will be opened only when Fast MA return below Slow and cross it upward again.

Kind regards,
FxPro Team

3. Newbie
Join Date
Jun 2016
Posts
4
Hi, sorry for the poor translation but I do not speak English well. I try to be brief. I want to know how to set limits on income and losses, apart from the "Stop Loss" and "Take Profit" established in the modules to buy and sell. That is, reach close operation when certain Pips gain or loss, a kind of Stop Loss and Take Profit hidden. Thank you very much.
Last edited by Torre777; 06-06-2016 at 10:45 PM.

4. Originally Posted by Torre777
Hi, sorry for the poor translation but I do not speak English well. I try to be brief. I want to know how to set limits on income and losses, apart from the "Stop Loss" and "Take Profit" established in the modules to buy and sell. That is, reach close operation when certain Pips gain or loss, a kind of Stop Loss and Take Profit hidden. Thank you very much.

Dear Torre777,

You can do this using the 'Order Data' node. You need to set Parameter to 'Profit pips' and compare it to desired value. It should be as follows:

IF
Order Data (Profit Pips) >= Target Profit in pips
OR
Order Data (Profit Pips) <= Max Loss in pips
THEN
Close Order

Kind regards,
FxPro Team

5. Newbie
Join Date
Jun 2016
Posts
4
Thank you very much for the help

6. Newbie
Join Date
Jun 2016
Posts
2

I want strategy to open new trade only above the entry price of last opened short trade. Trades magic should be the same.

Lets say I have opened short trades at 1.050, 1.060, and 1.080. I want new short trade (with same magic) opened only at price above 1.080.

This is how iam trying to do it - buy trade example

7. Newbie
Join Date
Jun 2016
Posts
1
hi! how to make so that after closing the order did not open a new one in the same direction and waited for an opposite signal? and no matter how he is closed to stop or manually

8. Originally Posted by mike111FXX

I want strategy to open new trade only above the entry price of last opened short trade. Trades magic should be the same.

Lets say I have opened short trades at 1.050, 1.060, and 1.080. I want new short trade (with same magic) opened only at price above 1.080.

This is how iam trying to do it - buy trade example
Dear mike111FXX,

You can do this by using the Number Variable node to store values between ticks.

See example on the screenshot below:

Kind regards,
FxPro Team

9. Originally Posted by lexahs
hi! how to make so that after closing the order did not open a new one in the same direction and waited for an opposite signal? and no matter how he is closed to stop or manually
Dear lexahs,

If you are using the same magic index for Buy and Sell positions, you can save the last open time for Buy and for Sell orders. You will have 3 possible situations:

2. Buy time < sell time => last position was Sell
3. Not one of the above => there was no trade

See example below:

Kind regards,
FxPro Team

10. Newbie
Join Date
Jun 2016
Posts
2
Dear FxPro support

Thnak you for the answer ! I have been trying to implement it for days, but it is still not working. Here is the screenshot: Please let me know what is wrong