Thanks.
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
Crossing of.
Collapse
X
-
Crossing of.
In Strategy Builder I have set 2 variables of a high and a low. What I want is to enter as soon as bid or ask crosses this value with an offset. But I get an error message that left and right expressions do not match. Am using on every tick so I do not wait till the close of a bar.
Thanks.Tags: None
-
Hello Trader17,
I would suggest changing your operator to >, greater than rather than cross above. CrossAbove when referenced from the Builder takes in two data series for its calculations, and GetCurrentBid is not a series.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
-
Hello Trader17,
To avoid having the condition remain true after its crossed above, you could create a Variable in the builder with a default setting of false, include an if statement checking that this variable is false, and upon your condition block becoming true, set this variable to true so that this block will not run again.
I put together screen shots for how this could be accomplished.
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
Comment
-
Got it. I do like your idea but am not too good at coding yet. Does the Builder have something like Open Trades/Positions in it? That could be used too as a condition like if Open Position < or = or something similar to stop it from opening trades at every tick.
Thanks.
Comment
-
Hello Trader17,
Yes, within the Strategy folder of the condition builder, you can add a if statement, MarketPosition == MarketPosition.Flat.
You could also set entries per direction and entry handling, to limit additional calls to EnterLong.
Please see,
Please let us know if you need further assistance.Alan P.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by helpwanted, Today, 03:06 AM
|
1 response
10 views
0 likes
|
Last Post Today, 03:35 AM | ||
Started by Brevo, Today, 01:45 AM
|
0 responses
9 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
242 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
387 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
Comment