Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Brake of range

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

    Brake of range

    HI,

    having a problem with a strategy syntax in one of the condiitions;

    In the attached indicator file lines 104 and 121 are not working as expected


    Condition for range broken on the high side (line 104):
    && (GetCurrentAsk(0)> (MAX(High, Convert.ToInt32(RangePeriods))[1])+(TicksORange)/TickSize)
    When current ask price is higher than (the maximum value over the last {RangePeriods} periods seen from the last candle + {TicksORange} ticks)


    Condition for range broken on the low side (line 121) x
    && (GetCurrentAsk(0)< (MIN(Low, Convert.ToInt32(RangePeriods))[1])-(TicksORange)/TickSize)
    When current ask price is lower than (the minimum value over the last {RangePeriods} periods seen from the last candle - {TicksORange} ticks)


    I also tried difining a variable on lines 74 and 76, to use them on lines 105 and 122 but that did not work either (so the lines are currently voided)

    Can you please help me rewrite the conditions to make this indicator work?

    Thanks​
    Horacio
    Attached Files

    #2
    Hello Horacio,

    This thread will remain open for any community members that would like to debug and correct your logic as a convenience to you.

    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.


    If you are interested in debugging the script yourself, add debugging prints one line above the condition. Print the time of the bar and all values compared in the condition along with labels for each value and comparison operator.

    Below is a link to a support article on adding debugging prints to understand behavior.


    Save the output (right-click the output window, select Save as) and attach the text file to your next post. Let us know the date and time where you are expecting the condition to evaluate as true.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DayTradingDEMON, Today, 11:25 PM
    0 responses
    3 views
    0 likes
    Last Post DayTradingDEMON  
    Started by Day_Storay1, Today, 09:06 PM
    0 responses
    6 views
    0 likes
    Last Post Day_Storay1  
    Started by Rudmax, 07-02-2024, 05:40 AM
    59 responses
    1,056 views
    1 like
    Last Post QuantVPS  
    Started by tomtom2000, Today, 12:56 PM
    3 responses
    18 views
    0 likes
    Last Post jabowery  
    Started by stoner, 01-16-2020, 08:07 AM
    20 responses
    514 views
    0 likes
    Last Post IanS00
    by IanS00
     
    Working...
    X