Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Fisher Transform question

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

    Fisher Transform question

    Hi,
    I REALLY suck at building even basic strategies. It won't work and I don't why.
    On backtesting it buys all over the place or not at all when it should.
    Indicators
    SMA 150 Fisher Transform 15 day
    Entry Price must be above SMA150
    Fisher Transform 15 day must be below -1
    Fisher Transform must cross up through an SMA 1 of itself + offset of 1

    Exit Fisher Transform line crosses down through SMA1 of itself + offset of 1

    Here is the code: (do I post here??)
    Thanks to anyone who can spot my probably simple error.


    Description = @"Enter when 1) Fisher Transform 15 Day less than - 1. 2) Price above 150 SMA 3)Fisher Transform crosses up through SMA of FIsher Transform 1 + 1 4) sell when Fisher Transform crosses down through SMA 1+1 (offset)";
    Name = "FisherXMAup1";
    Calculate = Calculate.OnBarClose;
    EntriesPerDirection = 1;
    EntryHandling = EntryHandling.AllEntries;
    IsExitOnSessionCloseStrategy = true;
    ExitOnSessionCloseSeconds = 30;
    IsFillLimitOnTouch = false;
    MaximumBarsLookBack = MaximumBarsLookBack.TwoHundredFiftySix;
    OrderFillResolution = OrderFillResolution.Standard;
    Slippage = 0;
    StartBehavior = StartBehavior.WaitUntilFlat;
    TimeInForce = TimeInForce.Gtc;
    TraceOrders = false;
    RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
    StopTargetHandling = StopTargetHandling.PerEntryExecution;
    BarsRequiredToTrade = 20;
    // Disable this property for performance gains in Strategy Analyzer optimizations
    // See the Help Guide for additional information
    IsInstantiatedOnEachOptimizationIteration = true;
    }
    else if (State == State.Configure)
    {
    }
    else if (State == State.DataLoaded)
    {
    FisherTransform1 = FisherTransform(Close, 15);
    FisherTransform1.Plots[0].Brush = Brushes.DodgerBlue;
    AddChartIndicator(FisherTransform1);
    SMA1 = SMA(Close, 150);
    SMA1.Plots[0].Brush = Brushes.Goldenrod;
    AddChartIndicator(SMA1);
    SMA2 = SMA(FisherTransform1, 1);
    SMA2.Plots[0].Brush = Brushes.Goldenrod;
    AddChartIndicator(SMA2);
    SMA3 = SMA(FisherTransform1, 1);
    SMA3.Plots[0].Brush = Brushes.Goldenrod;
    AddChartIndicator(SMA3);
    }
    }

    protected override void OnBarUpdate()
    {
    if (CurrentBars[0] < 15)
    return;

    // Set 1
    if ((FisherTransform1[0] < -1)
    && (Close[0] > SMA1[0])
    && (CrossAbove(FisherTransform1, SMA2, 1)))
    {
    EnterLong(Convert.ToInt32(DefaultQuantity), "");
    }

    // Set 2
    if (CrossBelow(FisherTransform1, SMA3, 1))
    {
    ExitLong(Convert.ToInt32(DefaultQuantity), "", "");
    }

    }
    }
    }

    #2
    Hello GeminiSi,

    Thank you for writing in.

    I would suggest adding print statements to check whether your conditions are becoming true. I’ve provided a link to a youtube video which covers an example of using prints to understand behavior:



    I’ve provided a link covering debugging which you may find helpful.
    Debugging: http://ninjatrader.com/support/forum...ead.php?t=3418

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    58 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    39 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    19 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    21 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    51 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X