NexusFi: Find Your Edge


Home Menu

 





Looking for help with contrarian use of a pivot breakout


Discussion in EasyLanguage Programming

Updated
    1. trending_up 1,306 views
    2. thumb_up 0 thanks given
    3. group 2 followers
    1. forum 1 posts
    2. attach_file 1 attachments




 
Search this Thread
  #1 (permalink)
xxjoocexx
Akron, Oh
 
Posts: 8 since Oct 2021
Thanks Given: 3
Thanks Received: 5

Hey all. I'm looking for some help with a switch or maybe a series of switches when using a pivot. I want to test a theory that a breakout/breakdown of a pivot high/low has a tendency to retrace momentarily. Here's a summary and example of what I'm trying to do:

Find a pivot high, record that value, look for a break and close above that value and go short. I have this working, but my problem is only doing it once. See image below, pivot at 4094.75 and horizontal line extended across for ease of reference.



Here's the code I used to do this:
 
Code
//triggers
Value1 = Pivot(high, 50, strength, strength, 1, 1, oPivotPrice, oPivotBar);
Value2 = oPivotPrice;	
BreakAbove= close > value2;

//check if preceding candle is a break above
If Breakabove[1] Then
	Begin
		FirstBreak = False;
	End
	Else 
		Begin
			FirstBreak = true;
		End;


//If Time > StartTime and Time < EODTime Then
//begin;
	If BreakAbove and FirstBreak Then
		Begin
			Sellshort ( "PIVRETS") next bar at Open;
			Print ( "date", Date, "time", time, "Short taken");
			BreakBody = Close-open; //getting the candle's body point value for exits
		End;
//End;
This stopped repeated occurrences except when the bars dip back below the recorded pivot high and break above again as in the picture (albeit slightly in this example). I'm drawing a blank on a way to turn off the setup after just one close above. Needs to reset when a new pivot is discovered. Any ideas?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
Trump Media to sell instant access to market-moving soci …
Traders Hideout
Datafeed for Atas
Platforms and Indicators
My Rant with AMP Futures
Trading Reviews and Vendors
No book, only a stair: journaling fills where price move …
Cryptocurrency
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Mes vs MNQ
6 thanks
NexusFi site changelog and issues/problem reporting
5 thanks
BERN ALGOS algo trading journal
3 thanks
Johnnys Journal
2 thanks
TopStep Trader disappointment
2 thanks
  #2 (permalink)
abev
seattle washington
 
Posts: 75 since Feb 2019
Thanks Given: 11
Thanks Received: 30

I think I get what you want. You are attempting to stop the entries after the first entry. I'd code an input for how many entries were allowed in a day and a counter so that only x entries may take place in a day. But that's me. I'd like to see what happens when I allow x entries and what I might learn from them. I see that both entries were green so .... why not allow multiple entries?

But... if you just want to stop multiple entries, I suspect you will need to zero or null the controlling variable after each bar has been evaluated -- looks to me like that variable is Value2. I've not tried/tested your code so take my suggestion with a grain (or more) of salt.


Reply With Quote




Last Updated on February 19, 2023


© 2026 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 - Downloads - Top
no new posts