futures io



ACSIL_checking condition fulfillments in last 15 bars


Discussion in Sierra Chart

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




Welcome to futures io: the largest futures trading community on the planet, with well over 150,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

ACSIL_checking condition fulfillments in last 15 bars

(login for full post details)
  #1 (permalink)
klumpi
Budapest, Hungary
 
 
Posts: 1 since May 2023
Thanks: 0 given, 0 received

Hi,

I created a code in ACSIL and I would like to ask some assistance how to code an additional condition. What I have done so far is I created three types of moving averages (RSI, EMA39, SMA) and defined a condition accordig to which the color of the bar ha to be changed into green once SMA9 crosses EMA39 from below. Now I want to add a new condition, according to which the crossover is valid only in case the value of RSI was below at 32 at least once in last 15 bars. How to modify the code with this condition? Thanks in advance

Here is the existing code:
#include "sierrachart.h"

SCDLLName("Crossover")

SCSFExport scsf_RSI(SCStudyInterfaceRef sc)
{
SCSubgraphRef RSI = sc.Subgraph[0];
SCSubgraphRef EMA39 = sc.Subgraph[1];
SCSubgraphRef SMA9 = sc.Subgraph[2];
SCSubgraphRef Cross = sc.Subgraph[3];
SCSubgraphRef Subgraph_Cross = sc.Subgraph[4];

if (sc.SetDefaults)
{
// Set the defaults
sc.GraphName = "Crossover";
sc.GraphRegion = 0;
//sc.Subgraph[0].Name = "RSI14";
//sc.Subgraph[1].Name = "EMA39";
//sc.Subgraph[2].Name = "SMA9";
//sc.Subgraph[3].Name = "Cross";

//sc.Subgraph[0].DrawStyle = DRAWSTYLE_LINE;
//sc.Subgraph[1].DrawStyle = DRAWSTYLE_LINE;
//sc.Subgraph[2].DrawStyle = DRAWSTYLE_LINE;
//sc.Subgraph[3].DrawStyle = DRAWSTYLE_LINE;

Subgraph_Cross.Name = "movavgcross";
Subgraph_Cross.DrawStyle = DRAWSTYLE_COLOR_BAR;
Subgraph_Cross.PrimaryColor = RGB(0,255,0);
sc.AutoLoop = 1;

return;
}
// RSI definíció.

sc.RSI(sc.BaseDataIn[SC_LAST], RSI, MOVAVGTYPE_WILDERS, 14);

// EMA39 definíció.

sc.ExponentialMovAvg(RSI, EMA39, sc.Index, 39);

//SMA9 definíció

sc.SimpleMovAvg(RSI, SMA9, sc.Index, 9);


// Do data processing
if
( (sc.CrossOver(SMA9, EMA39) == CROSS_FROM_BOTTOM)
)
Subgraph_Cross[sc.Index] = 1;
else
Subgraph_Cross[sc.Index] = 0;

}

Reply With Quote

Can you help answer these questions
from other members on futures io?
How to get Index/Equity Data for NT?
NinjaTrader
Mt5 Tradestation Integration
TradeStation
Platform & Broker POLL
Brokers
Tickeron
Trading Reviews and Vendors
Freelancer to build an Apps to Control TradeStation (TS) …
TradeStation
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Artificial Intelligence (AI) and Chat GPT
28 thanks
Spoo-nalysis ES e-mini futures S&P 500
27 thanks
New NinjaTrader
27 thanks
Is anyone actually making money?
18 thanks
how to avoid chop
6 thanks

 
(login for full post details)
  #2 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
 
Posts: 229 since Jun 2011
Thanks: 22 given, 334 received

Create a condition to check if the RSI < 30. If so store the bar index in a persistent int (RSILessThan30). Then add another condition to your crossover conditional check. if current bar index - RSILessThan30 =< 15

Follow me on Twitter Reply With Quote


futures io Trading Community Platforms and Indicators Sierra Chart > ACSIL_checking condition fulfillments in last 15 bars


Last Updated on May 24, 2023



Copyright © 2023 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts