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

Saving values from previous bars to execute the bwfractal strategy

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

    Saving values from previous bars to execute the bwfractal strategy

    I have a quick question about the question you addressed several months ago. What how should I go about saving a value for the bwfractal? My goal is to execute once the pivot is triggered but using the bwfractal indicator by itself wont suffice. Please see the comment below.



    Your condition is detecting that 3 bars ago the Upper Fractal had a value so you are placing a market order to go long 3 bars after the fractal. I think what you want is to save the value of the fractal into a variable as they are found and then in another set check to see if the price does crossabove (or crossed below) the variable to then place your entry order


    How do I save the value of the fractal into a variable as they are found and then in another set check to see if the price does crossabove (or crossed below) the variable to then place your entry order?
    Last edited by jwhite0hg9; 08-15-2021, 10:15 AM.

    #2
    Hello jwhite0hg9,

    Welcome to the NinjaTrader forums!

    I recommend giving this a try after watching the Strategy Builder 301 training video linked in the forum post below.


    In a unlocked script, the variable could be a double.

    For example:

    private double myDouble;

    myDouble = MyIndicator().IndicatorPlot[0]; // (this where the indicator value would be set to a value)

    if (CrossAbove(Close, myDouble, 1))
    {
    // cross above occurred
    }
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by sephichapdson, Today, 11:36 PM
    0 responses
    1 view
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,612 views
    0 likes
    Last Post aligator  
    Started by jaybedreamin, Today, 05:56 PM
    0 responses
    9 views
    0 likes
    Last Post jaybedreamin  
    Started by DJ888, 04-16-2024, 06:09 PM
    6 responses
    19 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by Jon17, Today, 04:33 PM
    0 responses
    6 views
    0 likes
    Last Post Jon17
    by Jon17
     
    Working...
    X