Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Strategy with uni-renko
Collapse
X
-
Strategy with uni-renko
Hi, is possible to set the stop loss not in pip but for example when there are 2 bar of opposite value? (i know i could just sum the value of reversal bars, but there is too much noise that get me out too early, even if the bar are not "completed" ; and so i should set a too big stop loss) -
Hello lorenzoP,
This would likely not be a set price so you would need to use logic to set the price of the order.
You could have a condition trigger a market order to exit the position.
To check that a bar is a down bar, check that the Close is less than the Open. Use 1 as the BarsAgo index to check this for the previous bar.
For example to check that the previous bar was a down bar you could write:
if (Close[1] < Open[1])
You could also set a stop market or stop limit order far below the bar, and then when the condition is true, change the price of the stop order to be the current bid price for a sell exit or the current ask price for a buy exit (depending on the direction of your position).
Below is a link to an example script that changes the price of a working stop order.
Chelsea B.NinjaTrader Customer Service
-
Hello lorenzoP,
With the Strategy Builder you can create a condition that compares the close to the open of the previous bar and you are able to submit a market order.
Also using the Strategy Builder it is possible to use an Exit order like ExitLongStopLimit() and change the price of this order after it is working.
I've ported an example I created for NinjaTrader 7 to NinjaTrader 8 to demonstrate this with the Strategy Builder.
The NT7 version can be found in the thread linked below.
http://ninjatrader.com/support/forum...458#post381458Attached FilesLast edited by NinjaTrader_ChelseaB; 05-16-2017, 08:10 AM.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Gerik, 12-21-2023, 08:20 AM
|
15 responses
201 views
0 likes
|
Last Post
by Mindset
Today, 02:06 PM
|
||
Started by visvabalaji, Today, 02:04 PM
|
0 responses
3 views
0 likes
|
Last Post
by visvabalaji
Today, 02:04 PM
|
||
Started by spottysallrite, Today, 11:31 AM
|
6 responses
14 views
0 likes
|
Last Post Today, 01:53 PM | ||
Started by volIQ, Yesterday, 04:28 PM
|
2 responses
16 views
0 likes
|
Last Post
by volIQ
Today, 01:42 PM
|
||
Started by adeelshahzad, Today, 11:49 AM
|
5 responses
16 views
0 likes
|
Last Post Today, 01:27 PM |
Comment