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)
It should work now :/
You have any further remarks?
@dynoweb
where in the code do i have to insert the print code of yours, that it shows me the calcs? In my output window, it doesn't show anything.
This code gives a very high TradeSize however if I change the code to..
..it works fine.
I don't really care, because the order generating is just random, Im not going to use those Supertrend crossovers.
However, I'm still interested why the first code generates a huge order size and the second generates as expected. Seems as with the first code the supertrend-values are just too close to price-action. Any ideas on this? There must probably be a more efficient way to code Supertrend crossovers.
Broker: TD Ameritrade (soon to be Schwab) & NinjaTrader
Trading: The indexes, ES, YM, NQ & RTY
Posts: 171 since Aug 2012
Thanks Given: 216
Thanks Received: 157
You might want to check if you are already in a trade before entering another trade.
if (Position.MarketPosition == MarketPosition.Flat)
{
if (goodEntryCondition)
{
place trade order
}
}
The way you have it in your code right now is every time the bar updates and your condition is true you are hitting EnterLong(..)
You can also do a check before your long exit
if (Position.MarketPosition == MarketPosition.Long)
{
ExitLong("Exit Long", "Buy Long"); // note the second arg is the signal name of your trade when you went long
}
thx for the remark. It worked fine however, as I had only 1 Trade per Direction and also before a new entry condition can appear it will always be a position close first. Thx nevertheless.
Do you have any ideas on how to improve the entry condition? In terms of code I mean?
Is there another/better way to code a switch of trend in supertrend?
Broker: TD Ameritrade (soon to be Schwab) & NinjaTrader
Trading: The indexes, ES, YM, NQ & RTY
Posts: 171 since Aug 2012
Thanks Given: 216
Thanks Received: 157
I'm not sure if you have access to the elite forums, but there are a lot of very experienced traders tracking their trades on a journal. Take a look at that if you have a chance.
I don't use the ana super trend indicators so I really can't say without digging into the code. But I've been working with the Stochastics indicator and using that to trigger my entries. It really can't be used by itself for auto trading since you need to know that you are in a trend and it's the first or second pull back on a trend for a trend continuation trade.
Also take a look at the Battle of the Bogs thread and inspect the code on those bots to see what they are doing.
Broker: TD Ameritrade (soon to be Schwab) & NinjaTrader
Trading: The indexes, ES, YM, NQ & RTY
Posts: 171 since Aug 2012
Thanks Given: 216
Thanks Received: 157
Hey Mike, I noticed you weren't an Elite Member, your not yellow or red
All joking aside, @sagetrade if you're serious at all about learning to trade you really need to bite the bullet and change your membership to Elite, you won't get a better value for that small amount of investment. That's your first winning trade.