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
Join Bid or Ask
Collapse
X
-
Hello,
Thank you for the clairification.
Yes you can utilize the Bid or Ask prices in script. The easiest way is to use the GetCurrentBid and GetCurrentAsk methods:
You can use these values in whatever equations you need to determine where the order is placed, depending on the order type you could also change the existing order to a new price or to Follow the price until filled.
To move a order, you would just need to call the Enter method for the entry order again using a new price, as long as the order is open when you call the Enter method it would modify the existing order.
I look forward to being for further assistance.JesseNinjaTrader Customer Service
Comment
-
Hello fiddy,
Thanks for your reply.
You can use position information to prevent entries, for example:
if (Position.MarketPosition == MarketPosition.Flat && your entry conditions)
{
// enter order here when flat and my conditions are true.
}
In the above "your entry conditions" would be your logic to determine the price to submit at. If the next time the code executes and the order has not filled then MarketPosition will remain flat and you would submit the new price/order using the same signal name, effectively following.Paul H.NinjaTrader Customer Service
Comment
-
what would happen in the example provided if the entry conditions are true and an order is submitted but not yet filled and the conditions are true again.... will a new order be submitted or will the old order be modified.
it is not clear to me how to go about modifying an existing order as opposed to submit a new order
Can you please provide some more detail
Comment
-
Hello fiddy,
Thanks for your reply.
I've created a short video with live data showing a simple strategy to address the questions you asked. I've even left out the market position check because the "EntriesPerDirection" is set to 1. http://screencast.com/t/w3zSjMIsqnt
If you have further questions I would encourage you to use your sim101 account and test out the questions similarly.Paul H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by lorem, Today, 09:18 AM
|
0 responses
2 views
0 likes
|
Last Post
by lorem
Today, 09:18 AM
|
||
Started by hazylizard, Today, 08:38 AM
|
4 responses
10 views
0 likes
|
Last Post
by hazylizard
Today, 09:16 AM
|
||
Started by geddyisodin, Today, 05:20 AM
|
2 responses
18 views
0 likes
|
Last Post
by geddyisodin
Today, 08:44 AM
|
||
Started by Max238, Today, 01:28 AM
|
5 responses
47 views
0 likes
|
Last Post
by Max238
Today, 08:30 AM
|
||
Started by giulyko00, Yesterday, 12:03 PM
|
3 responses
13 views
0 likes
|
Last Post Today, 08:26 AM |
Comment