NexusFi: Find Your Edge


Home Menu

 





Take profit at an offset moving average


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one jpthegreek1 with 2 posts (0 thanks)
    2. looks_two trendisyourfriend with 1 posts (1 thanks)
    3. looks_3 Chile with 1 posts (0 thanks)
    4. looks_4 blackgrey45 with 1 posts (0 thanks)
    1. trending_up 1,353 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
jpthegreek1
Charlotte North Carolina
 
Posts: 11 since Sep 2019
Thanks Given: 3
Thanks Received: 0

Is there a way to do a strategy that will take profit at the touch or within a certain percentage of an offset exponential moving average. Thank you so much everyone for your time


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Prop Firm Tracked Payouts Hit $115M in Q1 but Growth Fla …
Funded Trading Evaluation Firms
Roland Garros Final Day: $3M on Zverev at 80.5% -- Leban …
Prediction Markets & Event Contracts
Six Days to Kickoff: World Cup Prediction Markets Hit $1 …
Prediction Markets & Event Contracts
Victory Day Delivers: Russia-Ukraine Ceasefire Market Cl …
Prediction Markets & Event Contracts
Iran and Israel Stand Down: What $9M in Peace Contracts …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Big Mike in Ecuador
196 thanks
Sober Journey With S&P
27 thanks
30 Sessions
20 thanks
BERN ALGOS algo trading journal
8 thanks
Volume Indicators
8 thanks
  #2 (permalink)
 
blackgrey45's Avatar
 blackgrey45 
Maryland, US
 
Experience: Beginner
Platform: Sierra Chart
Broker: AMP Global
Trading: MES
Frequency: Several times daily
Duration: Minutes
Posts: 888 since Jul 2022
Thanks Given: 908
Thanks Received: 968

Yeah you can manually enter your orders when they hit the desired percentage/ema, but I am guessing you want to create an automated trading system for this strategy. There are lots of people on this forum that have created automated moving average strategies. Just search the forum and DM people with threads that look helpful. Sorry I couldn't be of more help, I still enter my orders manually lol.


Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 Chile 
Boston Massachusetts
 
Experience: Intermediate
Platform: NinjaTrader
Trading: Emini ES, Crude CL, Gold GC
Posts: 32 since Dec 2015
Thanks Given: 8
Thanks Received: 14


LET US KNOW HOW YOU MAKE OUT I AM INTERESTED IN THE ANSWER ALSO.

THANKS I AM SURE IT CAN BE DONE.


Reply With Quote
  #4 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
Legendary Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,580 since Oct 2009
Thanks Given: 4,267
Thanks Received: 6,202


jpthegreek1 View Post
Is there a way to do a strategy that will take profit at the touch or within a certain percentage of an offset exponential moving average. Thank you so much everyone for your time

That's the formula i would use to create an upper/lower bands around a moving average and would attach the take profit order to one of the bands depending on the direction of your trade:

 
Code
    // Define the length of the moving average
    int maLength = 20; // You can adjust this as needed

    // Calculate the moving average
    double movingAverage = SMA(maLength)[0];

    // Define the percentage for the bands
    double percentage = 5.0; // 5% for a 5% difference

    // Calculate the upper band
    double upperBand = movingAverage * (1 + (percentage / 100));

    // Calculate the lower band
    double lowerBand = movingAverage * (1 - (percentage / 100));


Reply With Quote
Thanked by:
  #5 (permalink)
jpthegreek1
Charlotte North Carolina
 
Posts: 11 since Sep 2019
Thanks Given: 3
Thanks Received: 0


trendisyourfriend View Post
That's the formula i would use to create an upper/lower bands around a moving average and would attach the take profit order to one of the bands depending on the direction of your trade:

 
Code
    // Define the length of the moving average
    int maLength = 20; // You can adjust this as needed

    // Calculate the moving average
    double movingAverage = SMA(maLength)[0];

    // Define the percentage for the bands
    double percentage = 5.0; // 5% for a 5% difference

    // Calculate the upper band
    double upperBand = movingAverage * (1 + (percentage / 100));

    // Calculate the lower band
    double lowerBand = movingAverage * (1 - (percentage / 100));

Thank you for this!!! Can it take profit and immediately go short?


Reply With Quote




Last Updated on August 31, 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