Hello how can I create an EA that, on the M1 timeline, draws a square showing the H1 candles?
-
how can I create an EA that, on the M1 timeline, draws a square showing the H1 candles?

-
Add a shared link to what you have done, most blocks can access different TF attributes
-
Do you really need the rectangles? Why not using variables only instead? That will make the EA far more efficient.
-
Thanks for responding friends, the idea is to use a table that is drawn with the temporality of one hour as a reference to know if the current candle where the crossing of moving averages occurred has already ended....
The strategy is like this:
Strategy: Simple EMA and SMA Crossover
Buy Strategy
Identify Initial Signal:
On a 1-minute candlestick chart, wait for a 123-period EMA to cross above a 233-period SMA.
This crossover should occur during a 1-hour session.
Confirm 1-Hour Session:
Wait for the 1-hour session where the crossover occurred to end.
Confirm that the 1-hour session has ended and that the current 1-hour session has opened.
Confirm Entry Signal:
Verify that the close of the 1-minute candle is higher than the high of the previous 1-hour session.
Execute Buy Order:
If all the above conditions are met, place a buy order.
Set Stop Loss:
The stop loss for the buy order should be set at the price of the EMA at the time of the entry signal.
Take Profit:
Keep the trade open until the close of a 1-minute candle is below the price of the EMA.
At that point, close the trade to secure the profit.
Example of Buy Strategy:
Identify Initial Signal:
On the 1-minute chart, the 123-period EMA crosses above the 233-period SMA during a 1-hour session.
Confirm 1-Hour Session:
Wait for the 1-hour session to end and the new 1-hour session to open.
Confirm Entry Signal:
The close of the 1-minute candle is higher than the high of the previous 1-hour session.
Execute Buy Order:
Place a buy order.
Set Stop Loss:
Set the stop loss at the price of the 123-period EMA.
Take Profit:
Close the trade when the close of a 1-minute candle is below the price of the 123-period EMA.
Sell Strategy
Identify Initial Signal:
On a 1-minute candlestick chart, wait for a 123-period EMA to cross below a 233-period SMA.
This crossover should occur during a 1-hour session.
Confirm 1-Hour Session:
Wait for the 1-hour session where the crossover occurred to end.
Confirm that the 1-hour session has ended and that the current 1-hour session has opened.
Confirm Entry Signal:
Verify that the close of the 1-minute candle is lower than the low of the previous 1-hour session.
Execute Sell Order:
If all the above conditions are met, place a sell order.
Set Stop Loss:
The stop loss for the sell order should be set at the price of the EMA at the time of the entry signal.
Take Profit:
Keep the trade open until the close of a 1-minute candle is above the price of the EMA.
At that point, close the trade to secure the profit.
Example of Sell Strategy:
Identify Initial Signal:
On the 1-minute chart, the 123-period EMA crosses below the 233-period SMA during a 1-hour session.
Confirm 1-Hour Session:
Wait for the 1-hour session to end and the new 1-hour session to open.
Confirm Entry Signal:
The close of the 1-minute candle is lower than the low of the previous 1-hour session.
Execute Sell Order:
Place a sell order.
Set Stop Loss:
Set the stop loss at the price of the 123-period EMA.
Take Profit:
Close the trade when the close of a 1-minute candle is above the price of the 123-period EMA.This is what I have managed to do so far:
https://fxdreema.com/shared/bReicVmlb -
This is the second reply for the exact same question. Please don't duplicate questions.
-
Personally, I would create separate EAs for each section, get one working then start the next, this way you are just asking for help on 1 problem you haven't managed to solve. Then add them together, everything in your list can be created here.
-
@l-andorrà I don't know what you mean, this is my thread about this request for help, which I have not been able to resolve
-
@jstap Thanks for commenting, I really don't want a whole huge list of things, what I need is this specifically...
On a 1-minute candlestick chart, wait for a 123-period EMA to cross above a 233-period SMA.
This crossover should occur during a 1-hour session.
Confirm 1-Hour Session:
Wait for the 1-hour session where the crossover occurred to end.
Confirm that the 1-hour session has ended and that the current 1-hour session has opened.
Confirm Entry Signal:
Verify that the close of the 1-minute candle is higher than the high of the previous 1-hour session.
Execute Buy Order:
If all the above conditions are met, place a buy order. -
I thought that drawing the charts of the H1 candles in M1 temporality would be the best way to identify if the one hour candle where the entry signal of the moving average crossing was given has already ended and I am on the next H1 candle to confirm the others conditions...
-
@DragonZueloTrends I can't contribute anything as far as the strategy itself but I can provide a project example of the 1 minute candles within the 1hr candle. It's not perfect and there are probably better ways of doing it but this is how I would go about it. I definitely agree that everything should be broken down first and I will add that it's best to create the conditions and have them draw arrows as confirmation/entries and if it work, then switch it out with orders.
I normally don't provide files but I will here because it would take more time explaining. I'd advise to review it and do it from scratch so that you'll have an idea on getting a similar project started.
-
@JayPhillbrooks Amigo, muchas gracias por tu valioso aporte, es una enorme ayuda