NexusFi: Find Your Edge


Home Menu

 





Questions and discussion for Sierra Chart ACSIL for Beginners


Discussion in Sierra Chart

Updated
      Top Posters
    1. looks_one Trembling Hand with 43 posts (35 thanks)
    2. looks_two mosalem2003 with 40 posts (0 thanks)
    3. looks_3 1m1k3 with 20 posts (0 thanks)
    4. looks_4 bradhouser with 6 posts (9 thanks)
      Best Posters
    1. looks_one bobwest with 3.5 thanks per post
    2. looks_two bradhouser with 1.5 thanks per post
    3. looks_3 brach with 1 thanks per post
    4. looks_4 Trembling Hand with 0.8 thanks per post
    1. trending_up 28,140 views
    2. thumb_up 53 thanks given
    3. group 30 followers
    1. forum 119 posts
    2. attach_file 25 attachments




 
Search this Thread

Questions and discussion for Sierra Chart ACSIL for Beginners

  #111 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 246 since Jun 2011
Thanks Given: 28
Thanks Received: 360


1m1k3 View Post
I can't set any multiplier number in the chart settings.
In nut shell... I want to change a chart's bar period with a pre set multiplier number by changing another chart's bar period.
For example I change the bar period on chart 1 from 25 sec to 30 sec then chart 2's bar period does change from 75 sec to 90 sec because I set the multiplier to 3.

Therefore I wrote a study to read the bar period and put that into a subgraph. This study is on chart 1.
And another study which gets that subgraph multiply it and set the bar period to that number. This study is on chart 2.
But it's not working properly. Sometimes works fine but most of the times something keep makes the chart 2 to recalculate for a while as if I'd press tha 'Insert' button continuously.


Sorry Looking at the code it seems like you are trying to do something very weird. My understanding from above is.
  1. Chart 1 is the base chart
  2. Chart 2 you want linked to Chart 1 by way of a period multiplier
  3. When you change the period in Chart 1, Chart 2 also changes period but by the set multiplier amount.

Follow me on Twitter Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
What broker to use for trading palladium futures
Commodities
Cheap historycal L1 data for stocks
Stocks and ETFs
REcommedations for programming help
Sierra Chart
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Quantum physics & Trading dynamics
The Elite Circle
 
  #112 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 246 since Jun 2011
Thanks Given: 28
Thanks Received: 360

Ok a second look and I see what you are trying to do but its the wrong method.


1m1k3 View Post
Therefore I wrote a study to read the bar period and put that into a subgraph.

A subgraph to store a single value is way too complicated. Just use a persistent int and reference it in the second chart.


 
Code
SCSFExport scsf_BarPeriodReading(SCStudyInterfaceRef sc)
{

    // Store bar period with this
    int& BarPeriodValue = sc.GetPersistentInt(0);

    if (sc.SetDefaults)
    {
        // Set the configuration and defaults.

        sc.GraphName = "Bar Period Reading";

        sc.AutoLoop = 0;
        sc.GraphRegion = 0;
        sc.UpdateAlways = 1;

        return;
    }

    // on change update the bar period
    if (sc.IsFullRecalculation && sc.Index == 0)
    {
        n_ACSIL::s_BarPeriod BarPeriod;
        sc.GetBarPeriodParameters(BarPeriod);

        if (BarPeriod.ChartDataType == INTRADAY_DATA && BarPeriod.IntradayChartBarPeriodType == IBPT_DAYS_MINS_SECS)
        {
            BarPeriodValue = BarPeriod.IntradayChartBarPeriodParameter1;
        }

        SCString DebugString;
        DebugString.Format("Changing Bar period to: %d", BarPeriodValue);
        sc.AddMessageToLog(DebugString, 1);

    }

}
 
Code
SCSFExport scsf_TF_Receiver2(SCStudyInterfaceRef sc)
{
    SCInputRef ChartStudy = sc.Input[0];
    SCInputRef MultiPlier = sc.Input[1];

    // Set configuration variables

    if (sc.SetDefaults)
    {
        // Set the configuration and defaults

        sc.GraphName = "TF Receiver 2";
        sc.CalculationPrecedence = LOW_PREC_LEVEL;
        sc.StudyVersion = 10;
        sc.AutoLoop = 0;


        ChartStudy.Name = "Study Reference";
        ChartStudy.SetChartStudyValues(1, 0);

        MultiPlier.Name = "Multiplier Value";
        MultiPlier.SetInt(3);

        return;
    }

    // Referance the stored bar period in chart 1
    int Chart1Period = sc.GetPersistentIntFromChartStudy(ChartStudy.GetChartNumber(), ChartStudy.GetStudyID(), 0);
    
    int NewTF = Chart1Period * MultiPlier.GetInt();

    n_ACSIL::s_BarPeriod BarPeriod;
    sc.GetBarPeriodParameters(BarPeriod);

    if (BarPeriod.ChartDataType == INTRADAY_DATA && BarPeriod.IntradayChartBarPeriodType == IBPT_DAYS_MINS_SECS)
    {
        int SecondsPerBar = BarPeriod.IntradayChartBarPeriodParameter1;
    }

    if (BarPeriod.ChartDataType != INTRADAY_DATA
        || BarPeriod.IntradayChartBarPeriodType != IBPT_DAYS_MINS_SECS
        || BarPeriod.IntradayChartBarPeriodParameter1 != NewTF)
    {
        n_ACSIL::s_BarPeriod NewBarPeriod;
        NewBarPeriod.ChartDataType = INTRADAY_DATA;
        NewBarPeriod.IntradayChartBarPeriodType = IBPT_DAYS_MINS_SECS;
        NewBarPeriod.IntradayChartBarPeriodParameter1 = NewTF;

        //Set the bar period parameters. This will go into effect after the study function returns.
        sc.SetBarPeriodParameters(NewBarPeriod);
    }


    if (sc.IsFullRecalculation && sc.Index == 0)
    {
        SCString DebugString;
        DebugString.Format("TF Ref: %d, NewTF: %d", Chart1Period, NewTF);
        sc.AddMessageToLog(DebugString, 1);
    }

    
}

Follow me on Twitter Started this thread Reply With Quote
Thanked by:
  #113 (permalink)
1m1k3
Budapest, Hungary
 
Posts: 21 since Dec 2022
Thanks Given: 4
Thanks Received: 0



Trembling Hand View Post
Sorry Looking at the code it seems like you are trying to do something very weird. My understanding from above is.
  1. Chart 1 is the base chart
  2. Chart 2 you want linked to Chart 1 by way of a period multiplier
  3. When you change the period in Chart 1, Chart 2 also changes period but by the set multiplier amount.

You got it right. I got confirmation from higher time frame. Tbh in my chart books there are 14 charts in two rows. In the bottom row from 20 sec to 60 sec and above them their multiplied pair. When I see setup on the higher time frame I have adjust 2 charts so these studies would make my trade easier.

I seen study like this but unfortunatelly I can't get that so I decided to write myself.

Here's a screenshot I did yesterday. For a while nothing's happened then all of a sudden chart 2 started to recalculate. In this case #3 is chart 1 and #2 is chart 2.


Reply With Quote
  #114 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 246 since Jun 2011
Thanks Given: 28
Thanks Received: 360


1m1k3 View Post
fortunatelly I can't get that so I decided to write myself.

So did the above code changes work?

Follow me on Twitter Started this thread Reply With Quote
  #115 (permalink)
1m1k3
Budapest, Hungary
 
Posts: 21 since Dec 2022
Thanks Given: 4
Thanks Received: 0


Trembling Hand View Post
So did the above code changes work?

It suppose to but not because it doesn't work properly. And since I can't figure out what causes the problem I asked help here.

Reply With Quote
  #116 (permalink)
 Trembling Hand 
Melbourne, Land of Oz
 
Experience: Advanced
Platform: Sierra Chart, CQG
Broker: CQG
Trading: HSI
Posts: 246 since Jun 2011
Thanks Given: 28
Thanks Received: 360


1m1k3 View Post
It suppose to but not because it doesn't work properly. And since I can't figure out what causes the problem I asked help here.

I'm talking about the code posted to fix you work.

Follow me on Twitter Started this thread Reply With Quote
  #117 (permalink)
1m1k3
Budapest, Hungary
 
Posts: 21 since Dec 2022
Thanks Given: 4
Thanks Received: 0


Trembling Hand View Post
I'm talking about the code posted to fix you work.

Ohhh ... Sorry!
I could've overlooked that post :O
I'll check it out this evening at home.

Reply With Quote
  #118 (permalink)
1m1k3
Budapest, Hungary
 
Posts: 21 since Dec 2022
Thanks Given: 4
Thanks Received: 0


Trembling Hand View Post
So did the above code changes work?

If I had to summarize it in one word it'd be 'brilliant'! It works as it should work.
And it way more simple this way than how I did it.

For this I'll bring you honey beer in the Valhalla till the end of the time
Ok, maybe that a bit exaggeration and you have to be content with a very big thank you from me

I'm not familiar with the persistent integers yet but it seems I will have to spend some time to learn how it works.

Many thanks for your help!

Reply With Quote
  #119 (permalink)
1m1k3
Budapest, Hungary
 
Posts: 21 since Dec 2022
Thanks Given: 4
Thanks Received: 0

Hi everyone,

Is there a way to make drawing tools with texts like in the Tradingview?

Reply With Quote
  #120 (permalink)
mosalem2003
Toronto
 
Posts: 103 since Apr 2019
Thanks Given: 106
Thanks Received: 23


My ACSIL trading system conditionally in certain conditions, submit an order to a different symbol than the symbol of the chart that the trading system ACSIL study is applied to..
The order submits successfully but doesn't fill, when changing the order type to Market order, it fills but at a very different price from the SIM quote prices.
I have reviewed all the items in the following two links that dictate how to submit an order to a different symbol or why orders would be non filled and all conditions have been fulfilled as per your documentation.

https://www.sierrachart.com/index.php?page=doc/ACSILTrading.html
https://www.sierrachart.com/index.php?page=doc/TradeSimulation.php


The trade activity log confirms that the order is submitted to the intended different symbol and to the same trade account.

Here is the code snippet for submitting the order.

 
Code
SCString different_symbol = "xyz.CME"; 

NewOrder.Symbol = different_symbol;  

NewOrder.TradeAccount = sc.SelectedTradeAccount; 

NewOrder.OrderQuantity = 1 

NewOrder.OrderType = SCT_ORDERTYPE_MARKET;  

sc.BuyOrder(NewOrder);

I am connected to the data feed while running the simulation.
I have ensured that the quote window provides an accurate ask/bid
The order shows on the different symbol opened chart that is running in sync in the replay as I run both charts in the same chartbook.
Trade activity log shows the order as accepted and submitted.
Order shows on the chart but it is a ghost order and not filled if it is a limit or stop limit and I specify also the limit as price2 for this type.
However , I changed to market order as above code to avoid this issue and the order fills but a totally different price from the market price while the replay.
I have downloaded all the data again for both symbols
The trade windows on both charts are also at same account
I also select the account by NewOrder.TradeAccount =sc.SelectedTradeAccount; and the trade log shows it is submitted to same SIM1 account...

Kindly advise what could be the main root cause behind such behavior and once again, I have confirmed that all your instructions in the above link are fulfilled...

Thanks a lot for your support.

Reply With Quote




Last Updated on April 23, 2024


© 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