Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Super Trend For Ninja Trader Needed
Collapse
X
-
Originally posted by Tzachi View PostHarry,
Do you have any financial incentive to refer us so many times to download indicators from big mike forum? It cost $50 to join the elite section and you always refer to the site when ask to help with an indicator.
Just wonder.....
I have personally learnt a lot from other members of the forum. You will find more than 300 indicators for NinjaTrader (I have personally coded and posted about 70). The forum is more convenient for developing indicators than the NinjaTrader forum, as it is more a trading community than a beginner's forum.
I am only refering to that forum, because I am not going to post the 70 indicators (and probably another 70 indicators somewhere posted in various threads) a second time. For many indicators, there are threads how to use them. Without those threads it is nearly impossible to understand some of the complex indicators, so even if I post them here, you would need to go there to find out the details.
Furthermore, I have replied to various private messages and sent some of the indicators via e-mail (only those that I have coded).Last edited by Harry; 07-24-2012, 12:59 PM.
Comment
-
Did you happen to install an older -previously downloaded- version of SuperTrendDemo ?
I'm asking because I updated the version in post #346 on 22/08/2011 because of the incorrect switching behaviour you are experiencing.
please re-download and import the current version from post #346, and click "yes" if on import NT asks to overwrite existing strategies.
let me know if it works.
Marco
Comment
-
How do I get it to place an order when it crosses instead of when the bar closes and start of new bar?
To make COBC = false default, you need to change the strategy code on line 41
from:
Code:CalculateOnBarClose = true;
Code:CalculateOnBarClose = false;
Also how would I go about adding an ATM strategy to this strategy?
Comment
-
Thanks marcow for the response, I did try the CalculateOnBarClose = false; and what it does is plots the TsSupertrend differently than if using CalculateOnBarClose = true; so if the last price has crossed with a chart that has the setting of CalculateOnBarClose = true; a chart that has CalculateOnBarClose = false; would be plotted way above current last price, I hope this is making sense? What I want is for the indicator to CalculateOnBarClose = true; but the order entry to trigger at the last price on chart so if last price is equal to the TsSupertrend then it will place order and not wait for bar close.
Is this possible?
Thanks Again
Comment
-
hello geotabs,
I understand that you want to run the indicator on COBC = true, but the strategy on COBC = false.
As far as I know this is not possible with a straight forward approach, because setting the strategy COBC = false will force COBC = false on all the indicators it is using.
However I use the following workaround:
set COBC = true in initialize of strategyCode:CalculateOnBarClose = true;
(you should add this method in the code, below the default OnBarUpdate() method )
Code:protected override void OnMarketData(MarketDataEventArgs e) { if (e.MarketDataType == MarketDataType.Last) // executes if incoming tick was a price change ( and not bid/ask change) { // put code here to check if price is above/below Supertrend indicator value. } }
I don't know your programming skills, so let me know if this works for you.
Marco
Comment
-
What I want is for the indicator to CalculateOnBarClose = true; but the order entry to trigger at the last price on chart so if last price is equal to the TsSupertrend then it will place order and not wait for bar close.
after reading your request in post#400 again, I realize that what you want can surely be done, but it is kind of risky. Here's why.
Imagine the price crosses below the green supertrend line intrabar, and the strategy enters a short position. What if the price goes up in that same bar, and that bar closes above the green line, so Supertrend remains on a long position ? There will be no upper red line to reverse this short position to long. You get a mismatch between indicator and strategy. Or do you want to use the stoploss to exit this position ?
please find attached the strategy as you requested. You can also see here how the OnMarketData() method is correctly integrated in the code. Import by copying the attached file in your strategies directory (C:\Users\*****\Documents\NinjaTrader 7\bin\Custom\Strategy), and then compile in NT
Also how would I add an extra target or 2?
The strategy attached takes 3 entries, with a profittarget of 10,20 and 30 ticks.please take a look at the code on line 55,56,57,91,92,93,103,104,105. The trick is to give each entry a unique name, and use that name in its profittarget, so NT knows which PT belongs to each entry.
Let me know if the strategy does what you want, or if you have other ideas.
MarcoAttached Files
Comment
-
Thanks Marco,
I see where I went wrong on entering the code
What I need this strategy for is for tick and 1 min charts
As for profit targets:
What I want is for 1 entry and 3 profit targets, so if I go long 3 contracts take profit at 10,20 and 30 ticks or 5,10 and 15 ticks depending on what I trade. Also if I only trade 2 contracts would it just have 2 profit targets and so forth for 1 contract?
I can't thank you enough for all the help Marco
Cheers
Comment
-
I see where I went wrong on entering the code
Yes, the strategy I posted has 3 entries. Entry_1 has a profittarget of 10, entry_2 has PT of 20 and entry_3 has PT of 30.
If you want to trade only 2 contracts, just comment out lines for the entries#3 (line 95 and 107) in the code. For 1 contract also comment out the entries#2 (I ussume you know how to comment out code do you ? just in case: put "//" in front of it so it turns green )
please find attached an updated version of the strategy, the stoploss for each entry didn't work correctly.
MarcoAttached Files
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ETFVoyageur, 05-18-2024, 12:45 AM
|
7 responses
42 views
0 likes
|
Last Post Today, 11:03 AM | ||
Started by woodyfox, 02-28-2019, 08:36 PM
|
26 responses
1,203 views
0 likes
|
Last Post Today, 10:57 AM | ||
Started by tkaboris, Yesterday, 07:53 PM
|
6 responses
20 views
0 likes
|
Last Post Today, 10:56 AM | ||
Started by FAQtrader, 04-25-2024, 12:00 PM
|
18 responses
295 views
0 likes
|
Last Post Today, 10:53 AM | ||
Started by ETFVoyageur, Yesterday, 12:26 PM
|
5 responses
23 views
0 likes
|
Last Post Today, 10:52 AM |
Comment