Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
PlusEV Wiki Page
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Component:Signal Generation
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= Signal Generation & Trade Management = == Purpose == '''"Should we trade? Which direction? Where's entry/stop/target?"''' This component is the decision maker. It receives graded setups from Layer 3 and decides: # Should we take this trade? (passes all gate filters) # Which direction? (LONG or SHORT) # Where to enter, stop, and exit? (entry techniques) ---- == Trading Market Principle == '''"Trade with the trend, not against it"''' * MA21 rising = LONG only β don't fight a rising market * MA21 declining = SHORT only β don't catch falling knives * MA21 flat = use MTF direction as tiebreaker * Gate filters protect capital β blocked hours, wrong zone, weak confirmation = skip * Only high-quality setups traded β A+, A, B grades only ---- == Decision Flow == <pre> βββββββββββββββββββββββββββββββββββ β Setup Quality Result (Layer 3) β β Grade: A+/A/B/C/D/F β βββββββββββββββββββββββββββββββββββ β βΌ βββββββββββββββββββββββββββββββββββ β GATE 1: Grade Filter β β Only A+, A, B pass β β C, D, F β REJECTED β βββββββββββββββββββββββββββββββββββ β βΌ βββββββββββββββββββββββββββββββββββ β GATE 2: Hour Filter β β Blocked: 9 AM, 10 PM, 11 PM β β (Loss-making hours) β βββββββββββββββββββββββββββββββββββ β βΌ βββββββββββββββββββββββββββββββββββ β GATE 3: Direction Determinationβ β MA21 rising β LONG β β MA21 declining β SHORT β β Flat/unclear β NO TRADE β βββββββββββββββββββββββββββββββββββ β βΌ βββββββββββββββββββββββββββββββββββ β GATE 4: Probability Zone Filterβ β Top third + LONG = OK β β Bottom third + LONG = BLOCKED β β (Trades with probability) β βββββββββββββββββββββββββββββββββββ β βΌ βββββββββββββββββββββββββββββββββββ β Calculate Entry/Stop/Target β β Generate Signal β βββββββββββββββββββββββββββββββββββ </pre> ---- == Gate Filters == === Gate 1: Grade Filter === Only high-quality setups are traded: {| class="wikitable" |- ! Grade !! Action |- | A+, A, B || PASS β Generate signal |- | C, D, F || BLOCKED β No signal generated |} === Gate 2: Hour Filter === Block historically loss-making hours: <pre> Blocked Hours: [9, 22, 23] // 9 AM, 10 PM, 11 PM IST IF current_hour IN blocked_hours: RETURN None // No signal </pre> === Gate 3: Direction Determination === Direction is determined by MA21 slope with 1H β 15m fallback: <pre> trend_direction = market_state.trend_direction IF trend_direction == "up": direction = LONG // MA21 rising β trade long ELIF trend_direction == "down": direction = SHORT // MA21 declining β trade short ELSE: // MA21 flat/unclear β use MTF fallback IF mtf_direction == "up": direction = LONG ELIF mtf_direction == "down": direction = SHORT ELSE: // TICKET-22: 1H β 15m fallback (matches TimeframeSettings) // Config: primary=1H, confirmation=15m, wait_for_15min_alignment=True one_hour_dir = timeframe_results['1h'].direction fifteen_min_dir = timeframe_results['15m'].direction // Priority 1: 1H + 15m agreement (strongest) IF one_hour_dir == fifteen_min_dir AND one_hour_dir IN ['up', 'down']: direction = LONG if one_hour_dir == 'up' else SHORT // Priority 2: 1H only (primary_timeframe) ELIF one_hour_dir IN ['up', 'down']: direction = LONG if one_hour_dir == 'up' else SHORT // Priority 3: 15m only (confirmation_timeframe) ELIF fifteen_min_dir IN ['up', 'down']: direction = LONG if fifteen_min_dir == 'up' else SHORT ELSE: RETURN None // ALL timeframes sideways β true consolidation </pre> '''Direction Hierarchy:''' # MA21 slope (5min) β primary # MTF primary_direction β first fallback # 1H + 15m agreement β strongest MTF signal # 1H only β primary_timeframe fallback # 15m only β confirmation_timeframe fallback # None β only if all sideways (true consolidation) === Gate 4: Probability Zone Filter === Filters trades based on price position within range: {| class="wikitable" |- ! Zone !! LONG !! SHORT !! Logic |- | Top Third || Blocked || Allowed || 80% continuation down, 15% up |- | Middle Half || Allowed || Allowed || Neutral zone |- | Bottom Third || Allowed || Blocked || 80% continuation up, 15% down |} '''Sideways Market Exception:''' In creeper/consolidation, uses mean reversion (opposite logic). ---- == Stop Loss Calculation == Stop placement based on entry technique: {| class="wikitable" |- ! Entry Technique !! LONG Stop !! SHORT Stop |- | GREEN_BAR_PULLBACK || Below pullback low || Above rally high |- | BREAKOUT_PULLBACK || min(last 3 lows) || max(last 3 highs) |- | MA_BOUNCE || MA21 - 5 points || MA21 + 5 points |- | BOS_ENTRY || min(last 10 lows) + buffer || max(last 10 highs) - buffer |- | DISCOUNT_ZONE || entry Γ 0.99 || entry Γ 1.01 |- | DEFAULT || entry - 40 points || entry + 40 points |} '''Minimum Stop Distance:''' 40 points (prevents tight stops hitting on noise) ---- == Take Profit Calculation == Implements "cut the move in half" principle: <pre> distance_to_ma = |entry_price - MA21| target_distance = distance_to_ma Γ 0.5 IF LONG: take_profit = entry_price + target_distance ELSE: take_profit = entry_price - target_distance </pre> '''Minimum R:R:''' 1.5 (target must be at least 1.5Γ risk) ---- == Cost Calculations == === Commission (Dhan Broker) === <pre> commission = position_size Γ Rs 20 per lot </pre> === CTT (Commodity Transaction Tax) === <pre> contract_value = entry_price Γ lot_size Γ position_size tax = contract_value Γ 0.0001 // 0.01% total (0.005% per leg) </pre> ---- == Configuration == {| class="wikitable" |- ! Parameter !! Value !! Description |- | <code>commission_per_lot</code> || 20.00 || Rs per lot (Dhan) |- | <code>transaction_tax_rate</code> || 0.00005 || 0.005% per leg Γ 2 = 0.01% CTT |- | <code>lot_size_multiplier</code> || 100 || MCX lot size |- | <code>min_stop_distance</code> || 40 || Minimum stop in points |- | <code>default_risk_reward</code> || 1.5 || Minimum R:R ratio |- | <code>enable_hour_filter</code> || True || Block loss-making hours |- | <code>blocked_hours</code> || [9, 22, 23] || Hours to skip |- | <code>enable_ma_direction_filter</code> || True || MA21 alignment required |- | <code>enable_probability_zone_filter</code> || True || Zone probability check |- | <code>enable_color_change_filter</code> || False || Disabled (too restrictive) |} ---- == Output == '''Signal Object:''' {| class="wikitable" |- ! Field !! Type !! Description |- | <code>direction</code> || Enum || LONG or SHORT |- | <code>entry_price</code> || float || Current close price |- | <code>stop_loss_price</code> || float || Calculated stop level |- | <code>take_profit_price</code> || float || Calculated target level |- | <code>position_size</code> || int || From setup quality (1 or 2 lots) |- | <code>setup_quality</code> || Enum || A+, A, or B |- | <code>entry_technique</code> || Enum || How stop was determined |} ---- == Dependencies == '''Upstream:''' * [[Component:Multi_Timeframe_Analysis|multi_timeframe_analysis.py]] - MTF direction fallback * [[Component:Market_State_Analysis|market_state_analysis.py]] - Trend direction, market state * [[Component:Setup_Quality_Detection|setup_quality_detection.py]] - Grade, position size '''Internal:''' * [[Component:Probability_Zone|probability_zone_analysis.py]] - Zone filtering logic '''Downstream:''' * [[Component:Trade_Execution|trade_execution_engine.py]] - Executes the signal ----
Summary:
Please note that all contributions to PlusEV Wiki Page may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
My wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Component:Signal Generation
Add topic