How to register values of variables Candle: Buy, Sell, low
-
Hello, I want to know, after a trade, how to register values of variables Candle: Buy, Sell, low, high?
How to create the variables?
Thanks in advanced
Good trades

-
This one probably can help: http://fxdreema.com/demo/mt4-variables
-
I appreciate the quick response.
But already studied this example, but these variables do not define me the purchase price, sale, low and high

and thank need more help please
-
Then this one: http://fxdreema.com/demo/mt4-loop-how-it-works
Using "For each Trade" you can load the last trade only if you have "Not more than n trades" set to 1. Then you can check that trade's parameters using Condition - find (in loop) category there.
-
Thanks, but this block can not know about the values of the candle (opening, closing, maximum and minimum) of the trade that this operation?
I think every trade, I write the variables, referring to the amount of sail, opening, closing, high and low, and then you can use later ...
How do I do that?
-
Every trade has information associated with it, attributes, parameters - lot size, type, sl, tp, open price, open time and others. Candles have these: open, high, low, close, time. I don't fully understand what you want to do with these? To get candle parameters of that candle where the trade was created?
-
Yes, i want to get candle parameters of that candle where the trade was created!
I want to compare the values with other candles candle that was made the trade.
To do that I need to record the values in variables, and then compare.
But as I record the values of the 4 variables that the trade was made? (buy, sell, low and high)?
-
If you want to know how to record variables, this is something on it's own, and I posted example of this. You can define variables and then modify them with any values, this is easy... but if you work with multiple trades at a time it's not useful.
The way to do this is: based on the open time of the trade to find the candle that is located at that time and get it's parameters, but at the moment in fxDreema there is no something that you can select directly, but I can try to add something like this because it's not a bad idea. The problem is because there are 3 steps:- Get Open Time from the trade
- Use that time to find the ID of the candle around this time, here you need to specify Market and Timeframe.
- Knowing the candle ID we can get high, low, open or close.
-
Directly as a code, if I am not wrong, it's something like this:
iLow(Symbol(), 0, iBarShift(Symbol(), 0, OrderOpenTime())) -
I really need an indication of how these variables the trade register in which values (open, closed, maximum and minimum), for example the variables do not have this example, but lots of values, and I can not define.
I know this is a simple example, so I ask can you please help me because without it I can not advance my strategy, thank you.
-
I'm lost again
For me variable is something that is defined and has value. Now I'm not sure if you want to get these values that I though you want... do you want (for example) to get Low of the candle where the trade is/was opened? -
yes, please...
-
Can you try with the code I posted before?
iLow(Symbol(), 0, iBarShift(Symbol(), 0, OrderOpenTime())) ```# here Symbol() means the current symbol, 0 means the current timeframe. iLow returns Low of the candle with ID that is get from iBarShift() function. OrderOpenTime() is the open time of the currently loaded trade, so I guess "For each Trade" block should be used to load trades. I even doubt if it's a good idea for me to add such a parameters. I can probably make it possible to get candle data not only from candle ID, but also from candle Time, but then you still need to get the trade's open time. I think that you are trying to do something in the hard way. Whan do you want to do with these candle levels, isn't it ok to just set SL or TP or pending orders at these levels when they still belongs to the current candle (0)? -
I'll study the best strategy and routines, then you need more help, I ask you. Thanks
Good Trades
