Enter in higher time frame but exit in lower time frame
Author: kelvinyip
Creation Date: 4/27/2020 12:46 PM
profile picture

kelvinyip

#1
Hi

Do you have any sample code
for entering trade in higher time frame(30 mins) but having stop loss in lower time frame (5 min) but exit is based on higher time frame (30 mins) ?

I can do everything is lower time frame (5 mins) using Synchronize function but the code gets complicated.. and I have done that with 30 mins and have my code backing up to daily to look for entries.

I have also use Synchronize at some point to just load external series for the same symbol for daily and 30 mins and tried to use it that way but getting the logic to sync for example by applying a moving average seems to be a bit complicated for me to do.

Is there a 3rd alternative with some sample ?


profile picture

Eugene

#2
Hi,

Your code has to execute on the lower bar scale (5-min), with SetScale* to compress the data for entries.
profile picture

kelvinyip

#3
That means there is no easier way than what I am doing now... if I read this properly ?
profile picture

Eugene

#4
Yes.
profile picture

Cone

#5
@kelvinyip -
If you need some help with your script, let me know. It doesn't have to be hard! It usually isn't ;)
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).