Ninjatrader strategies

C# 其它 外汇 C# OpenCL

指定

3B Strategy

Overview

While the spec breaks this down into step by step details, the model itself is low complexity, as its all done within 3 candles and simple exit criteria (no scaling, etc), intentionally done so for short time to market and management.


Assumptions:

  1. The strategy should run for one-to-many accounts, ideally avoiding a trade copier and keeping all control in our code.

  2. Multiple trades can be live at once and are independent of any other trade. (meaning we could be both long and short the same instrument).



  1. 3 candle pattern Setup: We will have a 3 candle pattern that this strategy is based on - for our purposes we will refer to those 3 candles as C1, C2, C3.   

    1. C1 - Order Block (OB) as defined in below spec. 

    2. C2 - The close of this candle determines if C1 is an OB or not, details below.

    3. C3 - in this strategy only C3 can be the Entry candle - Entry order would be at the opening price of the order block (C1).


  1. Orderblock identification logic (C1):

    1. Bullish OB : A candle is identified as Bullish OB if it closes lower than its open (meaning the Bullish OB is a red candle itself), followed by a subsequent candle (C2) closing above the high of the OB candle (meaning for Bullish OB, C2 is a green candle)

    2. Bearish OB: A candle is identified as Bearish OB if it closes higher than its open (meaning the Bearish OB is a green candle itself), followed by a subsequent candle (C2) closing below the low of the OB candle (meaning for Bearish OB, C2 is a red candle)


  1. Entry Conditions (C3) - Once the OB is identified, and OCO order should be placed that exists only for the life of this C3 candle.  If the trade is not triggered before the C3 candle closes, then the OB candle is no longer active for trading the 3B setup and the order is canceled.  

    1. For Bullish OBs 

      1. Order Type:  OCO - one cancels the other

      2. Direction:  Long

      3. Entry Price = OB (C1) Open 

      4. Stop:  Lowest low of C1/C2.

      5. Exit Target:  1R.   (ex. If we enter long at 100, stop at 90, target would be 110)

      6. Size (Number of Contracts):  Percent  of Account size will be used to calculate the number of contracts to enter. This is defaulted to 10%   See Appendix for Size calculation details for each instrument.

    2. For Bearish OBs  

      1. Order Type:  OCO - one cancels the other

      2. Direction:  Short

      3. Entry Price = OB (C1 Open

      4. Stop:  Highest high of C1/C2.

      5. Exit Target:  1R.   (ex. If we enter short at 100, stop at 120, target would be 80)

      6. Size (Number of Contracts):  Percent  of Account size will be used to calculate the number of contracts to enter. This is defaulted to 10%   See Appendix for Size calculation details for each instrument.



  1. TimeFrames and instruments in scope:  we will want to apply this setup to a number of tickers and timeframes for those tickers.  Whether that is best achieved by setting up this strategy one by one for each ticker/time frame combination, or if this one script can be configured for all the combinations is TBD based on the preference would be for whichever provides a more stable/high performing result.. Most probably the time frames are 5 Minutes, 15 Minutes and 1 Hour


  1.  Protection Features - as we are dealing with trading, we need to have robust protection features in place to ensure we dont get run-away behaviors. As such we need to place parameters is for:

    1. Max allowable trade Size - a dollar figure set by the user, default is $10000



Appendix

Trade Size Calculation (number of contracts):

We will calculate trade size based on percentage of total account size, ex. 10% of account size.  This will give us a dollar value of what we have as maximum (max) risk. 


We will then take this max risk number and use it to calculate the number of contracts to trade based on the instrument and the matrix below.


Detailed Steps:

  • 1. Requesting Account Size:

  • 2. Determining Max Trade Size:

    • Calculate the dollar amount to risk by multiplying the account size by the user-defined percentage, Ex 10%

  • 3. Instrument-Specific Calculation:

    • For each trade, use the calculated dollar amount to risk, along with the instrument's tick size and tick value, to determine the number of contracts or shares to trade.

    • The formula for this calculation is: 

      • Trade Size (Number of Contracts = Dollars risk per Trade / (Stop size in Tricks * Tick Value)

 

Instrument/Tick Size/Tick Value Matrix:

Instrument

Tick Size

Tick Value (USD)

MES (Micro E-mini S&P 500 Futures)

0.25

$1.25

MNQ (Micro E-mini NASDAQ-100 Futures)

0.25

$0.50

MCL (Micro Crude Oil Futures)

0.01

$0.10

MGC (Micro Gold Futures)

0.10

$1.00

M2K (Micro E-mini Russell 2000 Futures)

0.10

$0.50

MYM (Micro E-mini Dow Jones Futures)

1.00

$0.50


Example calculation:

To calculate the number of contracts to trade for the MNQ (Micro E-mini NASDAQ-100 Futures) with a $100 maximum risk size,  and a 10 tick stop size, we'll use the formula for trade size:

Let's define:

  • Dollar Risk per Trade: $100

  • Stop Size in Ticks: We'll need to define this based on your strategy. For this example, let's assume a stop size of 10 ticks.

  • Tick Value for MNQ: $0.50 per tick

Given these values, we can calculate the number of MNQ contracts to trade to not exceed a $100 risk.

Let's perform this calculation

Based on the given parameters ($100 maximum risk size, 10 tick stop size, and a tick value of $0.50 for MNQ), you would trade 20 contracts of the MNQ (Micro E-mini NASDAQ-100 Futures) to not exceed a $100 risk.




Example 1: Bullish OB Entry, Target hit. 

March 22, 2024, 4:05am EST, 5 minute chart



Example 2: Bearish OB Entry, Target hit.

March 21, 2024, 12:25pm EST, 5 minute chart



Example 3: Bullish OB Entry, Trade failed, Stop Hit:

March 22, 2024, 10:40am EST, 5 minute chart


Example 4: Bearish OB Entry, Trade failed, Stop Hit:

March 22, 2024, 13:30pm EST, 5 minute chart



相似订单
Hello .I have existing Tradingview strategy that I will like to automate to Mt4 EA based on my specification . I need an expert in the field that have experience in both tradingview and MT4
I want a developer who is an expert in deriv https://youtu.be/2euVfXYkrmE?feature=shared DIGIT MATCH bot I want a profitable robot I want a developer to do this task for me I want a developer who has experience in this
my style of trade is to manually scale position size up & down from 1 to 100+ micros as the market moves, so the indicator I need has nothing to do with scaling in & out of the position, but I need an indicator that dynamically trails the position P&L, And has a trailing daily max loss that will reject new order entry if triggered. Example is setting a $350 Position auto stop-loss so as I scale in & out of contracts
Hi, i have a simple strategy which has 4 different types of entries based on parabolic sar and moving average that I would like to be coded into an EA. I would also like some inputs for it like news filter, time start and time end, risk % and so on. Will discuss further upon application
Hey there, I need to convert an indicator from ninja to mt4 I will attach the ninjatrader indicator script to be converted into mt4 If you can do this kindly bid and let's discuss about the project Thanks
Hi there Here is a video of the logic: its based on market structure and swings using validated highs and lows based on candle closure. Just in case you would like to take a look at the code/indicator here is the link: https://youtu.be/igj0OaQoM7o?si=7nigL8OU2Nt1Zxkx Let me know if you can help
Nt8 30+ USD
I trade in NT8 and would like to code an Elliott wave measurment tool, which is very easy because I have the major Script for that.We need only to add some aspects into it. If you are interested,if you can do this do well to bid on it
I need you to convert this tradingview indicator (PineScript) to MT5. The indicator need to work in any time frame and as the proposed script. It need to plot the ATR bands (as you can see in the attached image) and work as the proposed routine of ATR bands, when price close above or below the bands, the bars will change color (as you can see in the script and the image attached). Instead of sending alerts of buying
"Seeking an adept developer to help realize my custom NT8 strategy. Your expertise is integral to achieving success in this project. Are you interested in teaming up for a productive collaboration? Let's discuss the details together. Thank you!"
NinjaTrader 8 indicator that plots open prices of higher time frame bars. Time frames to choose from in the properties: 15sec, 30sec, 1min, 5min, 15min, 30min, 1hr, 4hr, 1day, 1week, 1month, 1 year (or any time based periods if that would make the development easier). Ability to customize lines is needed (style, color, thickness, etc.). Also, ability to extend certain lines all the way to the right by clicking on

项目信息

预算
30 - 50 USD
开发人员
27 - 45 USD
截止日期
 4 天