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 proptradingshop, 03-21-2024, 09:50 AM
|
5 responses
26 views
0 likes
|
Last Post Today, 05:17 AM | ||
Started by MaupinFinche, Today, 05:08 AM
|
0 responses
2 views
0 likes
|
Last Post
by MaupinFinche
Today, 05:08 AM
|
||
Started by Enkidu, Yesterday, 06:40 AM
|
9 responses
35 views
0 likes
|
Last Post
by Enkidu
Yesterday, 01:11 PM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
12 responses
309 views
0 likes
|
Last Post
by z.franck
Today, 04:29 AM
|
||
Started by AgriTrdr, 07-16-2023, 12:54 PM
|
32 responses
268 views
0 likes
|
Last Post
by f.saeidi
Yesterday, 06:49 AM
|
Comment