Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 11:47:13 +0000



Exit on moving average crossover

View Count: 1296

[2017-07-25 01:46:32]
User143414 - Posts: 18
I'm coming over from Ninjatrader.

There I wrote an indicator (study) that will flatten a position and close open orders on a moving average crossover.

If the position is long, then a cross down triggers the exit. If a position is short, a cross up triggers the exit.

I HAVE A BUTTON ON THE TOOLBAR that can toggle this on and off.


Is there anything like this in SierraChart?

1) toolbar toggle
2) MA crossover exit (sensitive to direction)

Custom code? Samples of Code?

Thanks
[2017-07-25 05:26:54]
Sierra Chart Engineering - Posts: 104368
1. Yes, you can set up a control bar button to enable or disable automated trading (Trade >> Auto Trading Enabled - Global/Chart).

Refer to:
Control Bar

2. You can use either ACSIL or Spreadsheets for the automated trading. Refer to:
Automated Trading Management
Automated Trading From an Advanced Custom Study
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2017-08-01 21:46:49]
User143414 - Posts: 18
I would prefer to use ACSIL...and to have the study (?) / indicator be plug and play....

meaning that it does not reference the chart moving averages....with the identifiers SierraChart uses, it seems that each chart might have different indicators

I'm not a spreadsheet guy, or have a lot of small configuration pieces in different places...too easy to forget where things are

this study would use it's own internal moving averages (can I do that?), and perhaps have parameters for the intervals that get set during initialization

it would be able to identify the button on the toolbar and know if it was up or down, and use that as the decision as to be sensing / closing positions (would rather not have the button toggle all enable/disable auto trades, just for this study)

do you have any code in the installation that would point me in the right direction?

I have written some pretty sophisticated studies/indicators/trade management in Ninja and I started by studying other's code and then modifying it. Didn't know any C# when I started.

Thanks
[2017-08-02 05:17:59]
Sierra Chart Engineering - Posts: 104368
Here is the documentation for ACSIL:
Advanced Custom Study Interface and Language (ACSIL)

meaning that it does not reference the chart moving averages...
You will need to use the intermediate study calculation functions:
Working with Intermediate Study Calculation Functions

The documentation has examples and also makes reference to code examples provided with Sierra Chart.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account