NexusFi: Find Your Edge


Home Menu

 



Categories Help    






Some Random Entries


Show full/short entries Entries
Phantom of the Pits 4 *
From https://nexusfi.com/traders-hideout/4042-phantom-pits.html

Category The Elite Circle 
 
Suggest other entries I might like
Details: Phantom of the Pits
Category: The Elite Circle 


June 12th, 2010
Size: 371.46 KB
Downloaded: 538 times

Keywords: book
Lag Calculation for Octave (MatLab) 1 *
This script is inspired by John Ehlers works on using DSP for trading. His books and articles contain formulas that estimate lag for some indicators. However, how to estimate lag in general case?

This script uses the DFT Phase Response (PhR) to make this estimation. The negative shift in the PhR pushes the values to the right, thus delaying the signal. The raw PhR returns the angle value. However, we want to estimate lag in terms of bars (time delay). To do it, we need to take an account the frequency (or period) of the phase:

Lag = | min(Phase * Period) | = | min(Phase / Frequency) |

Then we need to take the minimal value and take its absolute value. We skip all frequencies above 0.5 (the maximum possible without aliasing).

Version: 0.1.1

Examples:

SMA(3):

>> a = [1];
>> b = [1/3,1/3,1/3];
>> lag(b,a)
ans = 1.0000


EMA(0.1):

>> a = [1,-0.9];
>> b = [0.1];
>> lag(b,a)
ans = 9.0000


Category The Elite Circle 
 
Suggest other entries I might like
Details: Lag Calculation for Octave (MatLab)
Category: The Elite Circle 


June 30th, 2014
Size: 2.17 KB
Downloaded: 1 times
NT8 Workspace Startup tool 5 *
NT8 Workspace Startup tool

I built this little tool to help reset my _WorkSpace.xml file.

Example of use:

Upon coding an indicator you forget to dispose of a resource so when pressing F5, NT8 crashes. The problem is NT8 will reload that last workspace....only to crash again....and again. You want to restart with another workspace loaded so you can fix the problem, right?

Well, the old and tedious way is to open your _WorkSpaces.xml file, search for OpenWorkspaces and delete the entries, replacing them with one/some default templates. After doing this a hundred times...I decided enough is enough

(I believe you can safe load NT8 to do a similar job, but I like the flexibility of choosing my own workspaces to load.)

When NT8 is closed just run the .exe file and drag and drop which workspaces you want to load up upon the next restart. Instructions are inside the zip file. Do not import into NinjaTrader!

If you wish to see inside the .exe file just use any decompiler like DotPeek.

*** The NT7 version is here



Category NinjaTrader 8 Indicators and More 
 
Suggest other entries I might like
Details: NT8 Workspace Startup tool
Category: NinjaTrader 8 Indicators and More 


March 9th, 2017
Size: 34.18 KB
Downloaded: 566 times
Bootstrapped Monte Carlo Expectancy for Robust Optimization in NT7 5 *
Description:
This algorithm is a custom performance index for the Default or Genetic optimization methods in NinjaTrader 7. Optimization with this index maximizes the 20th percentile of noise-injected bootstrapped expectancy. This metric is designed for robustness against worst case conditions. Note that due to the mathematics, the solution is not deterministic (run it multiple times, and you will get slightly different solutions each time).

Installation:
Add this file to your ...\NinjaTrader 7\bin\Custom\Type\ directory, open any indicator or strategy, and compile.

Details (this math is in here):
1. For a given series of trades of length N, the top 10% are removed, creating a modified series of trades of length N*0.9.
2. This modified series of trades is sampled *with replacement* for 10*N*0.9 samples. This series becomes the bootstrapped trade series.
3. Gaussian noise is a given mean and standard deviation is added to each bootstrapped sample.
4. Expectancy for this bootstrapped + noise series is calculated.
5. Steps 2 through 4 are done 5000 times, with different sampling from the Gaussian noise. This creates a distribution of expectancy.
6. Finally, the performance index returns the 20th percentile of these 5000 runs (so, the 1000th worst expectancy) to the NT optimizer.

Discussion:
Removal of the 10% best performing trades is an attempt to be pessimistic by assuming that the best 10% trades observed in the past will never repeat. We do not want total system performance to hang a few high-yielding trades.

Injecting noise to the bootstrapped sample accomplishes two things. First, it adds uncertainty to each bootstrapped series, thereby simulating diversity in the bootstrapped series (hopefully the diversity we would measure in a much larger sample). Secondly, it makes each bootstrap series unique. This means that we way calculate a distribution from the ensemble of bootstrapped series.

Any percentile may be returned. We could return the mean. By returning a value to the left of the mean, the 20th percentile, we are maximizing 80% of the distribution.

Note: Because we are injecting randomly sampled noise to the bootstrapped series, the solution from this performance index is not deterministic!

Suggestions:
If you use this, you should be comfortable changing the parameters found at the top of the algorithm. Adjusting the value of the standard deviation of the noise may make or break the robustness and success of this algorithm.


Category The Elite Circle 
 
Suggest other entries I might like
Details: Bootstrapped Monte Carlo Expectancy for Robust Optimization in NT7
Category: The Elite Circle 


February 3rd, 2013
Size: 9.40 KB
Downloaded: 243 times

Keywords: expectancy optimization bootstrap monte carlo
On Screen Day of Week Display 5 *
Note: If you find bugs, have feature requests, or anything else, post in THIS thread.

This is a simple indicator that allows you to plot the day of the week name on the sessions bar's start. You can name the days whatever you want(Mon,Monday,M), by manipulating the "Day Names" section.

If the day isn't labeled the way you want... E.g., the first session on a Forex template is Sunday, but if I want it to say "Monday," you can input "Monday" in the "Day1" text field.

This indicator works onEachTic, and will work on Daily and Intraday charts.

This indicator was created from specs in THIS post.

NOTE: Installing this indicator will create a folder called "BTMM," that's where the indicator will be.







---EDIT - V2 3March2022---
Adding an input, so that you can affix the labels to the BOTTOM of the chart.



Category NinjaTrader 8 Indicators and More 
 
Suggest other entries I might like
Details: On Screen Day of Week Display
Category: NinjaTrader 8 Indicators and More 


March 3rd, 2022
Size: 4.12 KB
Downloaded: 256 times
 



 
Category
 




© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top