Open a position based on trend/movement.
-
Hello everyone,
I would like to define a (bullish or bearish) movement and trigger only a single position within that movement.
If the position is closed by SL or TP, no other position will be opened until the current movement is completed.
The next position can only be possible in the opposite direction, at the beginning of the new movement.
Below you will find my code to achieve this.
How can I achieve this using fxDreema blocks?
Thank you for your support.if condition 1 then
uptrend=true;elseif condition 2 then
uptrend=false;
endif uptrend ~= old and uptrend == true
then
BUY
endif uptrend ~= old and uptrend == false
then
SELL
endold = uptrend;
-
Start by defining what/how you class triend, get ea working with this, then you can move on to the rest.
-
@jstap Let's consider the following example.
How can I achieve this using fxDreema blocks?
Please
if EMA[close, 50 periods] > EMA[close, 200 periods]
then
uptrend=true;elseif EMA[close, 50 periods] < EMA[close, 200 periods]
then
uptrend=false;
endif uptrend ~= old and uptrend == true
then
BUY
endif uptrend ~= old and uptrend == false
then
SELL
endold = uptrend;
-
1st part is easy, condition block 50>200= orange dot, 50<200= yellow dot. To set up old you will need to record true/false when conditions are true/false, and set up logic to depict your conditions.
-
@jstap Here's what I tried to do with the blocks.
-
Although true/false=1,2 I would still stick to 1 type, set up a test showing what happens in a comment or drawing an arrow, then when this is working you can add the other condition.
-
@jstap Is it already possible to open only one position per movement with fxDreema without my knowledge?
-
No trade/position block only allows 1, if using this your logic needs set up so, if 1 is running, then conditions are correct, open 2 etc.