Ninjatrader strategies

C# Sonstiges Forex C# OpenCL

Spezifikation

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



Ähnliche Aufträge
The future of the traders be a good traders and patient and humble person faithful loyalty to your job and last be a professional traders and helping a dream of us how to trade and etc,,,,,,,,,,,,,,,,,🤑
Firstly Indicator (1) or the first part \\ Draw a red line at the top of the zero candle _ M1 \\ Draw a blue line at the bottom of the zero _ M1 candle \\ Draw a red line at the top of the zero _ M2 candle \\ Draw a blue line at the bottom of the zero _ M2 candle \\ Draw a red line at the top of the zero candle _ M3 \\ Draw a blue line at the bottom of the zero _ M3 candle \\ Draw a red line at the top of the zero
Trend killer 30 - 200 USD
I Will thanks for allowing me to create and that's good for me and u thanks u very muchand I Will make a good job to work and no to scheme people
100% Automated Trading Forex Robot powered by AI (Artificial intelligence) PLUG AND PLAY NB 100% Automated Trading Forex Robot powered by AI (Artificial intelligence) PLUG AND PLAY THE ROBOT MUST ANALYSIS ITSELF AND GIVE ACCURATE SIGNALS AND EXECUTE TRADES WITH THE HELP OF AI ( ARTIFICIAL INTELLIGENCE) FOR ALL THE KING PRO ROBOT VPN SHOULD BE RENTED FROM THE MAIN ORIGINAL COPY AND THERE SHOULD BE AN OPTION FOR THEM
I am looking for a developer who can convert my Pine script code to MQ5 code. The code is for a trading strategy that I would like to use on the MetaTrader 5 platform. The code needs to be converted accurately and efficiently, with all of the original functionality preserved. The developer should have experience with both Pine script and MQ5, and should be able to provide a high-quality conversion in a timely manner
I want to create a dashboard that would show all currency pairs using my currency strength indicator, ADX, and my support and resistance indicator.I want to the job done as soon as possible
Meysam 30+ USD
ZigZag بر اساس اسیلاتور مورد نیاز است ایده شاخص یک نشانگر ZigZag ایجاد کنید که بر اساس مقادیر شدید تعیین شده با استفاده از نوسانگرها ساخته شده است. می‌تواند از هر نوسان‌گر نرمال‌شده کلاسیکی که دارای مناطق خرید و فروش بیش از حد است استفاده کند. الگوریتم ابتدا باید با نشانگر WPR اجرا شود، سپس به طور مشابه امکان ترسیم زیگزاگ با استفاده از نشانگرهای زیر را اضافه کنید: CCI چایکین RSI نوسانگر تصادفی الگوریتم و اصطلاحات
Blues of Joy 30+ USD
1.Lines to determine entries,use high and low strategy. 2.Arrows and symbols (NRTR)or Trailing stop to mark entry and exit points . 3.Pivot points to identify where future support and resistance levels might be,calculate previous levels . 4.Check available assets. 5.Use price action and combine it with Smart money concept strategy

Projektdetails

Budget
30 - 50 USD
Für die Entwickler
27 - 45 USD
Ausführungsfristen
bis 4 Tag(e)