Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Buy and Sell variables are initially set to false. Only Buy or Sell can be true at one time. If you look at the code carefully, there are instances where the variables are set back to false. ie if there there is an atmcancelorder or if the trade has just finished( filled )
No im running this as COBC = true. The point of running 1 tick timeframe is to pretty much run as COBC = false. However if you have an indicator that requires COBC = false and another to true, then it gets complicated. Is that what you are doing?
Yeah im assuming that error msg is because of that. Its hard to tell without seeing the code.
PM me if you need something more.
Buy and Sell variables are initially set to false. Only Buy or Sell can be true at one time. If you look at the code carefully, there are instances where the variables are set back to false. ie if there there is an atmcancelorder or if the trade has just finished( filled )
No im running this as COBC = true. The point of running 1 tick timeframe is to pretty much run as COBC = false. However if you have an indicator that requires COBC = false and another to true, then it gets complicated. Is that what you are doing?
Yeah im assuming that error msg is because of that. Its hard to tell without seeing the code.
PM me if you need something more.
James
Thanks James,
Two questions - when I'm calling the indicators, can they be COBC = false or do you comment out that line in the indicator. (see post #3 from the NT support thread that mentions that) I have set this strategy to COBC true and would like up-to-the-tick info from the indicator.
Gavin, orderlimitprice is just a variable for the Close[0]
Just remember if you are referencing the 500 tick range in the BarsinProgress == 1(1 tick) its Closes[0][0]
Zella,
I prefer running strategies on COBC = true. Just add a smaller timeframe and run the indicator on that. ie a 1 min chart with a 5 min. You cannot have an indicator on COBC = false and a strategy with the indicator set to COBC = true. It will calculate as it set to true
Platform: NinjaTrader, TOS, Multicharts, Open Source various
Trading: FDAX, cable/yen, FX, options on commodities
Posts: 67 since Jun 2009
Thanks Given: 16
Thanks Received: 10
jthom
Gavin, orderlimitprice is just a variable for the Close[0]
Just remember if you are referencing the 500 tick range in the BarsinProgress == 1(1 tick) its Closes[0][0]
James - I couldn't get your code to work so I kept at my own and came up with something that kind of works. The strat will close orders once the current price dips x ticks below the high of the last bar. This is for a strat with a long ATM created.
I just have to figure out how to express "close pending orders if n bars have passed with no fill" and it's there. I have posted on the NT forums asking for pointers in the right direction also so if they come up with something I'll post it here also. It's on the same thread you posted in about canceling orders after n ticks +/- movement.
Here is the full status section code,
// Check for a pending entry order if ( orderId.Length > 0)
{ string[] status = GetAtmStrategyEntryOrderStatus(orderId);
// If the status call can't find the order specified, the return array length will be zero otherwise it will hold elements
// Print some information about the strategy to the output window Print("126 At the end of TFL3BR"); Print("The current ATM Strategy market position is: " + GetAtmStrategyMarketPosition(atmStrategyId)); Print("The current ATM Strategy position quantity is: " + GetAtmStrategyPositionQuantity(atmStrategyId)); Print("The current ATM Strategy average price is: " + GetAtmStrategyPositionAveragePrice(atmStrategyId)); Print("The current ATM Strategy Unrealized PnL is: " + GetAtmStrategyUnrealizedProfitLoss(atmStrategyId)); Print("The current ATM Strategy Realized PnL is: " + GetAtmStrategyRealizedProfitLoss(atmStrategyId)); } }
Just by looking at your code there, it seems fine. Does it work properly? You will also need to put a buy cancel order in it. Ie Close [0] + 5 * TickSize < High[1]
Does it run on COBC = false? Because if it doesnt you will need to use a smaller timeframe for the cancel option which is 1 tick.
Looks good.
Also if you want to talk about it, I have a voice ventrillo server. You can download that for free. PM me for details.
Platform: NinjaTrader, TOS, Multicharts, Open Source various
Trading: FDAX, cable/yen, FX, options on commodities
Posts: 67 since Jun 2009
Thanks Given: 16
Thanks Received: 10
Hey James - I think it works OK. I need to test it on a sim feed today though. Haven't tried it with bar close set to false. As I'm running tick charts I haven't tried anything with COBC = false.
So if it doesn't run on COBC = false do you reckon I should test with a 1 tick chart?
I may take you up on that offer to talk about it. You seem to know your stuff!! Will PM you about it.