
এই কৌশলটি একটি উদ্ভাবনী ট্রেডিং সিস্টেম যা ফেয়ার ভ্যালু গ্যাপ (FVG) এর উপর ভিত্তি করে এবং বাজারে মূল্যের ফাঁক এবং লেনদেনের পরিমাণের অস্বাভাবিকতা সনাক্ত করে সম্ভাব্য ব্যবসায়ের সুযোগগুলি ধরার জন্য। এই কৌশলটি গতিশীল গণনা প্রক্রিয়া এবং একীভূতকরণ প্রক্রিয়াজাতকরণের সাথে একত্রিত হয়েছে, যা কেবলমাত্র ক্রয়-বিক্রয় সংকেতগুলিকে সঠিকভাবে সনাক্ত করতে সক্ষম নয়, তবে ব্যবসায়ীদের বাজারের কাঠামোটি আরও ভালভাবে বুঝতে সহায়তা করার জন্য এটির ভিজ্যুয়াল উপস্থাপনা করে।
কৌশলটির মূল বিষয় হল ক্রমাগত K লাইনের মধ্যে মূল্যের ফাঁকগুলি পর্যবেক্ষণ করে সম্ভাব্য লেনদেনের সুযোগগুলি চিহ্নিত করা।
এটি একটি মূল্য কাঠামোর উপর ভিত্তি করে একটি উদ্ভাবনী লেনদেন কৌশল, যা যুক্তিসঙ্গত মূল্যের ফাঁকগুলির বুদ্ধিমান সনাক্তকরণ এবং যাচাইয়ের মাধ্যমে বাজারের সুযোগগুলি ক্যাপচার করে। কৌশলটির নকশা ধারণা পরিষ্কার, বাস্তবায়নের পদ্ধতি পেশাদার, ভাল স্কেলযোগ্যতা রয়েছে। প্রস্তাবিত অপ্টিমাইজেশনের দিকনির্দেশের মাধ্যমে কৌশলটির স্থায়িত্ব এবং লাভজনকতা আরও বাড়ানোর সম্ভাবনা রয়েছে।
/*backtest
start: 2024-02-22 00:00:00
end: 2025-02-19 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// ----------------------------------------------------------------------------
// This Pine Script™ code is subject to the terms of the Mozilla Public License
// 2.0 at https://mozilla.org/MPL/2.0/
// © OmegaTools
// ----------------------------------------------------------------------------
//@version=5
strategy("FVG Oscillator Strategy",
shorttitle="FVG Osc v5 [Strategy]",
overlay=false,
initial_capital=100000,
default_qty_type=strategy.percent_of_equity,
default_qty_value=100)
//------------------------------------------------------------------------------
// 1) Input Parameters
//------------------------------------------------------------------------------
lnt = input.int(50, "Bars Back")
area = input.bool(true, "Show Areas")
upcol = input.color(#2962ff, "Positive Color")
dncol = input.color(#e91e63, "Negative Color")
//------------------------------------------------------------------------------
// 2) FVG Detection
// bfvg = bullish FVG, sfvg = bearish FVG
//------------------------------------------------------------------------------
bfvg = low > high[2]
sfvg = high < low[2]
//------------------------------------------------------------------------------
// 3) Additional Conditions - FVG Verification (Volume, Gap Size)
//------------------------------------------------------------------------------
vol = volume > ta.sma(volume, 10)
batr = (low - high[2]) > ta.sma(low - high[2], lnt) * 1.5
satr = (high - low[2]) > ta.sma(high - low[2], lnt) * 1.5
//------------------------------------------------------------------------------
// 4) Sum of Bullish / Bearish FVG within the Last lnt Bars
//------------------------------------------------------------------------------
countup = math.sum(bfvg ? 1 : 0, lnt) // +1 for each BFVG
countdown = math.sum(sfvg ? -1 : 0, lnt) // -1 for each SFVG
//------------------------------------------------------------------------------
// 5) Verification (e.g., Require Higher Volume or Large Gap)
//------------------------------------------------------------------------------
verifyb = (bfvg and vol[1]) or (bfvg and batr)
verifys = (sfvg and vol[1]) or (sfvg and satr)
//------------------------------------------------------------------------------
// 6) Normalized Gap Values
//------------------------------------------------------------------------------
normb = ((low - high[2]) * countup * 0.75) / ta.highest(low - high[2], lnt)
norms = ((high - low[2]) * countdown * 0.75) / ta.lowest(high - low[2], lnt)
//------------------------------------------------------------------------------
// 7) Total Net FVG Count + Calculation of Maximum for fill()
//------------------------------------------------------------------------------
totcount = countup + countdown
max = math.max(
ta.highest(countup, 200),
ta.highest(math.abs(countdown), 200)
)
//------------------------------------------------------------------------------
// 8) Plotting Values (as in an indicator – can be kept for visualization)
//------------------------------------------------------------------------------
up = plot(countup, "Buy FVG", color=upcol, display=display.none)
down = plot(countdown, "Sell FVG", color=dncol, display=display.none)
zero = plot(0, "", color.new(color.gray, 100), display=display.none, editable=false)
// Net Value (sum of FVG)
plot(totcount, "Net Value", color=color.new(color.gray, 50))
// Filling areas above/below zero
plot(verifyb ? normb : na, "Long Pattern Width", color=upcol, linewidth=1, style=plot.style_histogram)
plot(verifys ? norms : na, "Short Pattern Width", color=dncol, linewidth=1, style=plot.style_histogram)
//------------------------------------------------------------------------------
// 9) Simple Trading Logic (STRATEGY)
//------------------------------------------------------------------------------
// - If "verifyb" is detected, go long.
// - If "verifys" is detected, go short.
//
// You can extend this with Stop Loss, Take Profit,
// closing old positions, etc.
//------------------------------------------------------------------------------
bool goLong = verifyb
bool goShort = verifys
// Basic example: Open Long if verifyb, Open Short if verifys.
if goLong
// First close any short position if it exists
if strategy.position_size < 0
strategy.close("Short FVG")
// Then open Long
strategy.entry("Long FVG", strategy.long)
if goShort
// First close any long position if it exists
if strategy.position_size > 0
strategy.close("Long FVG")
// Then open Short
strategy.entry("Short FVG", strategy.short)