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 705 views
    2. thumb_up 1 thanks given
    3. group 4 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Take profit at an offset moving average

  #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?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
ZombieSqueeze
Platforms and Indicators
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
What broker to use for trading palladium futures
Commodities
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
24 thanks
What is Markets Chat (markets.chat) real-time trading ro …
19 thanks
ApexTraderFunding.com experience and review
16 thanks
GFIs1 1 DAX trade per day journal
12 thanks
EG Indicators
11 thanks
  #2 (permalink)
 
blackgrey45's Avatar
 blackgrey45 
Marco Island, FL
Legendary Market Wizard
 
Experience: Beginner
Platform: Sierra Chart
Broker: AMP Global
Trading: MCL MES
Frequency: Several times daily
Duration: Minutes
Posts: 788 since Jul 2022
Thanks Given: 877
Thanks Received: 913

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: 31 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
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,527 since Oct 2009
Thanks Given: 4,177
Thanks Received: 6,021


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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts