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, 05: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 Cross161, Yesterday, 10:33 PM
0 responses
4 views
0 likes
Last Post Cross161  
Started by neilzep, Yesterday, 08:55 PM
0 responses
6 views
0 likes
Last Post neilzep
by neilzep
 
Started by javier.filgueira, Yesterday, 03:29 PM
3 responses
10 views
0 likes
Last Post javier.filgueira  
Started by Da vinci, Yesterday, 03:15 PM
1 response
8 views
0 likes
Last Post NinjaTrader_ChrisL  
Started by Da vinci, Yesterday, 02:51 PM
1 response
14 views
0 likes
Last Post NinjaTrader_ChrisL  
Working...
X