Go Back   NinjaTrader Support Forum > NinjaTrader 7 > Platform Technical Support

Platform Technical Support General platform technical support for NinjaTrader 7.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 08-12-2017, 06:04 AM   #1
GeminiSi
Junior Member
 
Join Date: Jul 2016
Posts: 14
Thanks: 5
Thanked 0 times in 0 posts
Default 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), "", "");
}

}
}
}
GeminiSi is offline  
Reply With Quote
Old 08-13-2017, 12:41 PM   #2
NinjaTrader_AlanP
NinjaTrader Customer Service
 
NinjaTrader_AlanP's Avatar
 
Join Date: Apr 2016
Location: Denver, CO
Posts: 1,378
Thanks: 115
Thanked 276 times in 266 posts
Default

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:

https://www.youtube.com/watch?v=K8v_...tu.be&t=48m45s

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.
NinjaTrader_AlanP is online now  
Reply With Quote
The following user says thank you to NinjaTrader_AlanP for this post:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fisher Transform pworroll General Development 6 09-22-2014 05:31 AM
Fisher Transform macroman Indicator Development 1 03-04-2013 10:55 AM
Fisher Transform is a 'method' ?? Trader.Jon Strategy Development 3 12-08-2010 09:10 AM
Fisher Transform Alarm chonwayne Indicator Development 2 01-31-2009 07:57 PM
Fisher Transform pgabriel Indicator Development 3 01-03-2009 07:23 PM


All times are GMT -6. The time now is 01:20 PM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.