NexusFi: Find Your Edge


Home Menu

 





Help on one day reversal strategy coding.


Discussion in MultiCharts

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




 
Search this Thread
  #1 (permalink)
Dallasboy
dallas texas
 
Posts: 17 since Jan 2016
Thanks Given: 6
Thanks Received: 4

Hi all,

I am try to code this simple reversal strategy:

If previous day open < close (an up bar), then sellshort the next bar.
Stop is previous bar's high (the up bar) plus say 25% of range.

 
Code
inputs:
	StopLoss ((high[1]-low[1])*.25);
	
if open < close then
	sellshort next bar at open;


SetStopShare;

SetStopLoss (StopLoss+(high[1]-open));

setexitonclose;
It tries to use the values from 2 bar back it seems.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Peace Expired NO: Ceasefire on Life Support, OPEC a …
Prediction Markets & Event Contracts
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
Election Sunday Resolves: Peru Heads to Runoff at 42pct, …
Prediction Markets & Event Contracts
TradingView Deploys AI to Monitor SEC Filings in Real Ti …
TradingView
Weekend Update: First Qatari LNG Transit Attempted -- IR …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
23 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,447 since Apr 2013
Thanks Given: 493
Thanks Received: 1,639


Dallasboy View Post
It tries to use the values from 2 bar back it seems.

Dallasboy,

for what does it seem to use the values from two bars back?
The entries seem exactly where you'd expect them i.e. the next bar after a bar that had an open lower then the close.

For the stop amount this might be caused by your code not using intrabar order generation, which means values are updated at the end of the bar only.

Regards,

ABCTG


Follow me on X Reply With Quote




Last Updated on July 20, 2016


© 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