Hi all, I'm trying to wedge in the MACD into a multiple timeframe. Scope is to create: 1) an alert when the MACD across all timeframes is positive, 2) an alert when the MACD across all timeframes is negative, and 3) one when neither of them is applicable.
Would anyone be so kind to give it some thoughts, please?
TF_global = TF_1 and TF_2 and TF_3 and TF_4 TF_global_bear = TF_1 == false and TF_2 == false and TF_3 == false and TF_4 == false TF_global_color = TF_global ? green : TF_global_bear ? red : white TF_trigger_width = TF_global ? 6 : width
cleaned up the MACD references in the MTF snippets
Note di rilascio
⋅
updated the exit points
Note di rilascio
⋅
polished the exit points
Note di rilascio
⋅
polished the name
Note di rilascio
⋅
Guys, I need some help, please.
1) why doesn't my script close a position when TF_global_off kicks in? and 2) why there is a gap of time between the fulfilment of a condition (all green or all red) and the actual opening?
thanks in advance
Note di rilascio
⋅
further polishing
Note di rilascio
⋅
this should be the final version. Exit points correctly visualised and good results. only regret I have is that I would prefer to be able to count data from the open of the candle, instead of the close.
alertcondition(title="EXIT LONG", condition=TF_global_bear or TF_global_off, message= "EXIT LONG")
alertcondition(title="EXIT SHORT", condition=TF_global or TF_global_off, message= "EXIT SHORT")
Littlefish2020
⋅
@marcoderoni, you are a genius. I set the time frames to 4 hours and 1 day and can get 85%. Thank you!
Littlefish2020
⋅
@marcoderoni, when I try to set the alarm, it says "this alert may trigger differently than expected, since it's based on an indicator that can get repainted." How can we set the alarm? Thanks.
Miketinkle
⋅
Good idea
AmyLand
⋅
Thanks
Erkam
⋅
If you use close in security, this will cause you problems.
marcoderoni
⋅
@Erkam, thanks! Can I ask you for one further suggestion? I see that instead of keeping a position, my script is opening and closing it several times, would you know why, by chance?
Erkam
⋅
@marcoderoni, You must use close [1] in security.
In this way, you can take the closed candle in resolution.
If you use Close, it will give you fake results.
Erkam
⋅
@Erkam, You can use version 3 or version 4 to get real results.