• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy does not load

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • NinjaTrader_ChelseaB
    replied
    Hello lorenzoP,

    If 'Include Commission' is set to True, then yes, any commissions setup would be included with the Net Profit.
    http://ninjatrader.com/support/helpG...a_strategy.htm

    Leave a comment:


  • lorenzoP
    replied
    Hi, another question, in the strategy analyzer, does the total net profit include commision or not?
    Last edited by lorenzoP; 05-27-2017, 04:41 AM.

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello lorenzoP,

    Thanks for your reply.

    In the strategy analyzer, it would be, in your example 1000 units of whatever the per unit value is of the instrument.

    Leave a comment:


  • lorenzoP
    replied
    ill do it, i have a general question:
    does the strategy analyzer uses leverage? if i set 1000 as order size this mean that im open a position for example with 1000 euro, right?

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello lorenzoP,

    Thanks for your reply.

    I was not aware of that, thank-you.

    In that case, move the line AddChartIndicator(PriceBreakoutRectangularBase(upw ardBreakout,volumeMultiple)); to the state == state.Dataloaded section.

    Leave a comment:


  • lorenzoP
    replied
    Hi, there is also an indicator, with the same name of the strategy, as said i have not change nothing about the original strategy (you can find it in the download section)
    ill try changing the "current bur"

    Leave a comment:


  • NinjaTrader_PaulH
    replied
    Hello lorenzoP,

    Thanks for your posts.

    In general, if you cannot load the strategy then you would want to observe the "log" tab of the control center as there may be errors in the loading process of the strategy that will show in the log but would not be something the compiler would be able to catch.

    Taking a quick look at the first post attachment it looks like you are using AddChartIndicator(PriceBreakoutRectangularBase(upw ardBreakout,volumeMultiple)); The PriceBreakoutRectangularBase() is a strategy, not an indicator so it cannot be added to the chart like an indicator. AddChartIndicator() should only be used in State.DataLoaded.

    Your second line of code in OnBarUpdate() is: if ((Close[1] > EMA1[1]) this line will generate a run time error that you would see in the Log tab. On the very first bar of data loaded the code is trying to look back one bar which does not yet exist. You would need to employ a check of the "CurrentBar" to ensure enough bars are loaded before trying to access them. Reference: http://ninjatrader.com/support/helpG...currentbar.htm
    Later on, it appears you are accessing the index of [2] so you might want to use as the first line of code in OnBarUpdate() if (CurrentBar < 2) return; to prevent bar index access errors.

    Commenting out (or removing) the AddChartIndicator in State = State.Configure and adding the CurrentBar check should allow your strategy to load/run.

    Leave a comment:


  • lorenzoP
    replied
    here the the original one:
    Attached Files

    Leave a comment:


  • lorenzoP
    started a topic Strategy does not load

    Strategy does not load

    im trying to create a strategy mixing price breakout (a free strategy find here) and another one. i would like to use the same type of trail stop, but using different entry. so i copied the entry condition: and all other stuff like private ... and under propritie

    it gives me no error but i cannot enable it

    i have attached a txt with the code
    Attached Files

Latest Posts

Collapse

Topics Statistics Last Post
Started by RogerLin, Today, 12:49 PM
1 response
10 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by Plaket, Today, 12:54 PM
1 response
8 views
0 likes
Last Post NinjaTrader_PaulH  
Started by dasziel, Today, 04:04 AM
2 responses
7 views
0 likes
Last Post eDanny
by eDanny
 
Started by Simon Thompson, Yesterday, 11:00 PM
2 responses
15 views
0 likes
Last Post eDanny
by eDanny
 
Started by chinapassage, Today, 12:26 PM
2 responses
5 views
0 likes
Last Post chinapassage  
Working...
X