Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to enter on OPEN exit on CLOSE of current bar using Strategy Builder Wzard?
Collapse
X
-
How to enter on OPEN exit on CLOSE of current bar using Strategy Builder Wzard?
I'm sure it's obvious once you know how to do it, but I can't figure it out. Using one-minute bars and a condition of (previous bar = Bearish Engulfing candlestick) I want to sell the open of the current bar and exit by buying the close of the current bar.Tags: None
-
Hi Calvin, thanks for writing in. This will require the use of IsFirstTickOfBar. The first set will be if(IsFirstTickOfBar == true && <entry condition>) and the exit will be
if(Position.MarketPosition == MarketPosition.Long(or Short)) and the strategy will keep track of the current bar by using a variable. I have an example of this here:
https://ninjatrader.com/support/foru...ce#post1190417
To check the market position, select "Current Market Position" on the left side, and then "MarketPosition>Long" on the right side. IsFirstTickOfBar can also be found in the Misc folder.
Kind regards,
-ChrisLLast edited by NinjaTrader_ChrisL; 07-18-2022, 09:10 AM.
-
I was only able to follow some of what you said. Here is what I was able to put together:
SET !
IfFirstTickOfBar = True
CandleStickPattern(ChartPattern BearishEngulfing, 4)[0] = 1
Do the following
EnterShort(DefaultQuantity, "").
SET 2
BarsSinceEntryExecution(0, "", 0) = 0
Do the following
ExitShort(DefaultQuantity. "")
It seems to do what I want. Would you please take a look at it and let me know if there's anything else I need to do?
Many thanks for your help. Calvin
Comment
-
Hi, thanks for posting, The builder is able to read the first tick of the bar using IsFirstTickOfBar, so you will need to run the script with Calculate = OnEackTick to enter the market at the start of the bar. I have a related example here for you to reference:
Hi, I'm currently working on a strategy that is utilizing OnTickChange data using the linked method. I am using a Tick Chart. The strategy uses onTickChange to make intrabar entry, and does so fine with the Set1 and Set2, but if/when profit target is hit, it will submit another order after the profit target if the
Unfortunately, I do not have a ready-made example of what you are asking about specifically.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
54 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
130 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
72 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
44 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|
Comment