Announcement

Collapse
No announcement yet.

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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    46 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    22 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    31 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    50 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Working...
    X