How to put stop at current low after enering in buy?

Questions about MultiCharts and user contributed studies.
User avatar
Xurma
Posts: 31
Joined: 24 Nov 2020
Has thanked: 9 times

How to put stop at current low after enering in buy?

Postby Xurma » 28 Dec 2020

Hello.
I'm testing break out strategy and I have condition that I don't know how to program for backtest.
Strategy have condition to enter but when we send "buy next bar market" we don't know stop level for sending it.
The stop level will be clear after entering in position at the next bar. It will be current low of the Session on the moment when buy order is filled.
How to program it?

User avatar
Vlada MultiCharts
Posts: 293
Joined: 22 Apr 2020
Has thanked: 8 times
Been thanked: 76 times

Re: How to put stop at current low after enering in buy?

Postby Vlada MultiCharts » 05 Feb 2021

Hello Xurma,

We can recommend checking the operation of a pre-built function lows(0). Check the attached.

Also, you can view the code of the pre-built New Low for Day indicator.
Attachments
MultiCharts_Example.png
(34.45 KiB) Not downloaded yet

User avatar
Xurma
Posts: 31
Joined: 24 Nov 2020
Has thanked: 9 times

Re: How to put stop at current low after enering in buy?

Postby Xurma » 08 Feb 2021

Hello Xurma,

We can recommend checking the operation of a pre-built function lows(0). Check the attached.

Also, you can view the code of the pre-built New Low for Day indicator.
Thank you for answer. My strategy was on 1 day time frame, and I already did it with 2 data windows. First data window was with 15 minute TF and second with 1 day TF. And it is working with lows(0) function as well. I hoped there was easy way to do it with only one window and only one data series.


Return to “MultiCharts”