Thank you
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
Reversal bar
Collapse
X
-
Hi PatrickH,
Thank you for your reply,
what I mean is a simply enable/disable the strategy when the price reaches certain level for example if hit a resistence, toggle "sell next reversal bar" or support "buy next reversal bar".
Don´t know if there is a way to create two buttons in the GUI panel with that.
Thanks
Comment
-
Hello Adolfo,
We have an example that adds some buttons here: https://ninjatrader.com/support/help...trolcollection
This could be used to set a bool variable from the button event handler. After setting the bool variable to true, In other parts of your logic, check if that bool variable is true and if so do your logic or dont do the logic based on the value of the variable.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
-
Thank you Jesse,
This is exactly what I want, but as I have no experience in ninjascript, what part of the code do I have to modify for example when I click "long" in advance the order is only executed when there is a reversal bar up and vice versa for short.
Thank you
Comment
-
Hello Adolfo,
Thank you for the reply.
In case you have no experience with NinjaScript, this would be a more complex item to create. The Buttons event handler would be where your logic would go: OnMyButtonClick
Inside of the event handler, you could do whatever logic you need to trigger the next event. The button handler applies to both buttons as shown in the sample so you would need to filter which clicked it by the buttons name.
When working with event handlers this may also entail that you use TriggerCustomEvent because the buttons event handler is out of the event driven context. This ensures the prices used are correct at the time the button is pressed.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Stanfillirenfro, Today, 07:23 AM
|
1 response
4 views
0 likes
|
Last Post Today, 07:37 AM | ||
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
2 responses
22 views
0 likes
|
Last Post Today, 07:24 AM | ||
Started by olisav57, Yesterday, 07:39 PM
|
1 response
9 views
0 likes
|
Last Post Today, 07:23 AM | ||
Started by cocoescala, 10-12-2018, 11:02 PM
|
7 responses
944 views
0 likes
|
Last Post
by Jquiroz1975
Today, 07:21 AM
|
||
Started by oviejo, Today, 12:28 AM
|
1 response
12 views
0 likes
|
Last Post Today, 07:20 AM |
Comment