NexusFi: Find Your Edge


Home Menu

 





I need help with ... (ask any question)


Discussion in Traders Hideout

Updated
      Top Posters
    1. looks_one bobwest with 153 posts (94 thanks)
    2. looks_two Big Mike with 88 posts (82 thanks)
    3. looks_3 Philip Hutchinson with 10 posts (0 thanks)
    4. looks_4 xplorer with 9 posts (6 thanks)
      Best Posters
    1. looks_one josh with 3.7 thanks per post
    2. looks_two Daytrader999 with 2.5 thanks per post
    3. looks_3 Big Mike with 0.9 thanks per post
    4. looks_4 bobwest with 0.6 thanks per post
    1. trending_up 104,775 views
    2. thumb_up 387 thanks given
    3. group 325 followers
    1. forum 587 posts
    2. attach_file 42 attachments




 
 

I need help with ... (ask any question)

 
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,172 since Jan 2013
Thanks Given: 57,524
Thanks Received: 26,292


clickandgrab808 View Post
CAN ANYONE HELP ME FIX THE ERRORS WITH THIS STRATEGY CODE


// MACD and Bollinger Bands Scalping Strategy

using System;
using NinjaTrader.Cbi;
using NinjaTrader.Gui.Tools;
using NinjaTrader.NinjaScript;
using NinjaTrader.Data;

namespace NinjaTrader.NinjaScript.Strategies
{
public class MACDBBScalpingStrategy : Strategy
{
private MACD macd;
private Bollinger bollinger;

protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = "MACD and Bollinger Bands Scalping Strategy";
Calculate = Calculate.OnEachTick;
EntriesPerDirection = 1;
EntryHandling = EntryHandling.AllEntries;
IsOverlay = false;
BarsRequiredToTrade = 20;
}
else if (State == State.Configure)
{
macd = MACD(FastEmaPeriod, SlowEmaPeriod, SignalEmaPeriod);
bollinger = Bollinger(BollingerPeriod, BollingerDeviation);
}
}

protected override void OnBarUpdate()
{
if (CurrentBars[0] < BollingerPeriod)
return;

if (CrossAbove(macd.Default, macd.Signal, 1))
{
if (Close[0] > bollinger.Upper[0])
{
EnterLong("Buy");
}
}
else if (CrossBelow(macd.Default, macd.Signal, 1) || Close[0] < bollinger.Middle[0])
{
ExitLong("Buy");
}
}

#region Properties

[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Fast EMA Period", Order = 1, GroupName = "Parameters")]
public int FastEmaPeriod { get; set; } = 12;

[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Slow EMA Period", Order = 2, GroupName = "Parameters")]
public int SlowEmaPeriod { get; set; } = 26;

[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Signal EMA Period", Order = 3, GroupName = "Parameters")]
public int SignalEmaPeriod { get; set; } = 9;

[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Bollinger Period", Order = 4, GroupName = "Parameters")]
public int BollingerPeriod { get; set; } = 20;

[NinjaScriptProperty]
[Range(0.1, double.MaxValue)]
[Display(Name = "Bollinger Deviation", Order = 5, GroupName = "Parameters")]
public double BollingerDeviation { get; set; } = 2.0;

#endregion
}
}

ERRORS

Hi @clickandgrab808,

It's easy to have these kinds of problems when trying to write code, particularly when it's in a language or application that you are not familiar with as a programmer.

In this "ask any question" thread, what we do is transfer members' questions to the appropriate sections of the forum where they are most likely to find someone with an interest in their issue and with the knowledge to be of help. In this case, I am copying your post to the "Want your NinjaTrader STRATEGY created for free?" thread. This is a resource you may not have been familiar with, but it has been helpful to many others. There is also a similar thread for asking for help on indicators if you ever need that.

You can access the new post by clicking this rectangle:



You should look there for any replies.

Two additional notes:
1. When you go to that location, please attach a file containing your code, in addition to listing it in the post itself. Anyone who is going to look at your code will need to read it in a file, not in the unformatted text that the system, unfortunately, prints it as when you post it. It is also a very good idea to explain, in regular English, what you want to finished code to do, rather than make someone try to work through it and guess what you intended.

2. I see that you made a similar request in an entry titled "ninja script error," which unfortunately you put in the "Help, Tutorials and How-Tos" articles section of the Wiki, which is meant to be a reference of answers, sort of like an encyclopedia, not of questions you want answered. ( ) I am deleting that entry, as it is in the wrong place.

Good luck.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
 
 
 
mewddsltd's Avatar
 mewddsltd 
Anthem, AZ
 
Experience: Intermediate
Platform: NinjaTrader8
Trading: Futures
Posts: 192 since Aug 2020
Thanks Given: 40
Thanks Received: 338

can't speak to the profitability but this compiles ..
this was moved ..

.. you don't have to be the first one at the party .. just be part of the party ..
Thanked by:
 
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,172 since Jan 2013
Thanks Given: 57,524
Thanks Received: 26,292



mewddsltd View Post
can't speak to the profitability but this compiles ..
this was moved ..

Hi @mewddsltd,

If you're talking about the posted strategy by @clickandgrab808 above, the current residence of his strategy is the free strategy thread, as indicated in the prior post, so anything else about it should be there ( @trendisyourfriend has shown some suggested modifications to it there.)

Just to let you and anyone else know, in general posts in this "ask any question" thread are very temporary. They come here via the "Ask your first question" shortcut on the main page, or other links. They are intended mostly for new members, or infrequent posters, who know what they want to ask about, but don't know enough about the forum to know where to post their question.

We look at the new posts in this thread and decide where they would ideally have gone, and then copy them to the forum section/area/thread that seems most likely to be a good one for it to be seen and responded to by others with a similar interest. So in this case, @clickandgrab808's post was transferred to the free strategy thread, and quickly got a response.

Sometimes something will sit here for a bit, because I am not always as on top of things as I should be. But I think just about everything that has come there has been re-routed to a better location, and some have sparked off significant discussions (not all, but that's the way a forum works.)

For these reasons, in most cases there is no point to reply to a post that shows up in this thread, because ideally it will soon be on its way to a better location, which is the place to reply to it.

This is just a general FYI, for anyone who has wondered what posts in this thread are about, and why they are generally followed by posts somewhere else.

Bob.

----------------------

Edit: I see where @mewddsltd has shifted his response to the original post to the free strategy thread after it was transferred there, which was the best thing to do. I just was slow to catch on to what I was seeing.

I'll leave this post as-is anyway, as it may help anyone to understand the way the "ask any question" thread works.

When one door closes, another opens.
-- Cervantes, Don Quixote
 
mam2424
tehran iran
 
Posts: 1 since Jun 2023
Thanks Given: 0
Thanks Received: 0

hi thanks you
im having problem in to time input the posion .how time spayk a chart?
please guide me.
thanks

 
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,172 since Jan 2013
Thanks Given: 57,524
Thanks Received: 26,292


mam2424 View Post
hi thanks you
im having problem in to time input the posion .how time spayk a chart?
please guide me.
thanks

Hi @mam2424,

I am sorry, but I do not understand your question.

If you are having a language problem with English, perhaps you can use Google Translate to translate your question from your language into English.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote
 
sndeepb12
Bangalore India
 
Posts: 1 since Nov 2020
Thanks Given: 0
Thanks Received: 0

Hi, I want to upload a NT8 indicator file, can any one help me with it.

 
mborne77
Charleston, SC USA
 
Posts: 3 since Mar 2023
Thanks Given: 3
Thanks Received: 0

How do I set up NQ and ES side by side accurately to see which way they're going that might be different from each other? Like if I use 5min charts, how do I know that i have them both set at the right height or bottom to make sure Im looking at the right differences. Thanks!

 
 
BullHorn's Avatar
 BullHorn 
Norfolk, Va. United States
 
Experience: Beginner
Platform: NT8, TNav, TC2K, TOS
Trading: ES
Posts: 13 since Dec 2013
Thanks Given: 6
Thanks Received: 3

I have a few ideas to program into NT8 but I'm NOT a programmer.
Anyone would like to add my ideas to this platform via programming.
PLEASE
Let me know
TY
Chris Brock

 
 rscr 
san jose costa rica
 
Experience: Intermediate
Platform: trading station
Trading: forex
Posts: 22 since Jun 2014
Thanks Given: 135
Thanks Received: 9

For the math inclined.
Scalp strategy for trading day trading ES. with win rate of 60%
On loss increase lot size using the following progression for a 6 steps progression:1-1-1-2-5-10
On win you double your lot size and on 2nd win = restart progression
In other words - win 2 in a row you return to step one
What is the probability of winning twice in a row before losing 6 th step? -Minus 20 Units.

Thanking for your comments in advance.

 
 
bobwest's Avatar
 bobwest 
Western Florida
Site Moderator
 
Experience: Advanced
Platform: Sierra Chart
Trading: ES, YM
Frequency: Several times daily
Duration: Minutes
Posts: 8,172 since Jan 2013
Thanks Given: 57,524
Thanks Received: 26,292



mborne77 View Post
How do I set up NQ and ES side by side accurately to see which way they're going that might be different from each other? Like if I use 5min charts, how do I know that i have them both set at the right height or bottom to make sure Im looking at the right differences. Thanks!

Hi @mborne77,

In this "ask any question" thread, we try to find a location in the forum where a member's question is most likely to be be seen and hopefully responded to by other traders of similar interests, and then create a new thread for their post in that location.

You have a very general-interest question, so I have transferred it to the "Traders HIdeout" section, which is for generic type questions. You can access your new thread by clicking here:



If there are any replies, that is where to find them.

Good luck.

Bob.

When one door closes, another opens.
-- Cervantes, Don Quixote

 



Last Updated on February 22, 2024


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts