alert once per bar, only for taking profit

Questions about MultiCharts and user contributed studies.
gannlover13
Posts: 8
Joined: 15 Aug 2014
Has thanked: 8 times

alert once per bar, only for taking profit

Postby gannlover13 » 12 Mar 2015

Hello guys,

I run a script on 5 minute-basis where buy and sell-signals are based on 5 minutes, fully automated.
However, when my profitstop in script is met I now have to wait until the 5 minute-bar is ended before an alert will close my trade and take the profit.

This is not what I like to see, because my target was already met in the first minute of the 5-minutebar.

How can I code my script (indicator) that AT ANY TIME within the 5 minute-bar the profit will be taken immediately when my profittarget is hit.

In my alertbox I now have highlighted: "on bar close" and that is ok, because my entry and stoploss ARE on bar close. The exception is thus de profitstop where I don't want to wait the full 5 minutes before exiting my trade.

Thx for help,

regards, Cees

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: alert once per bar, only for taking profit

Postby TJ » 12 Mar 2015

Hello guys,
I run a script on 5 minute-basis where buy and sell-signals are based on 5 minutes, fully automated.
However, when my profitstop in script is met I now have to wait until the 5 minute-bar is ended before an alert will close my trade and take the profit.
This is not what I like to see, because my target was already met in the first minute of the 5-minutebar.
How can I code my script (indicator) that AT ANY TIME within the 5 minute-bar the profit will be taken immediately when my profittarget is hit.
In my alertbox I now have highlighted: "on bar close" and that is ok, because my entry and stoploss ARE on bar close. The exception is thus de profitstop where I don't want to wait the full 5 minutes before exiting my trade.
Thx for help,
regards, Cees
Look up:

IntrabarOrderGeneration


Return to “MultiCharts”