NexusFi: Find Your Edge


Home Menu

 





About Days Back


Discussion in TradeStation

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




 
Search this Thread

About Days Back

  #1 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3

I think there is a Days Back in chart, but is there also a radar screen?

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
Quantum physics & Trading dynamics
The Elite Circle
 
  #2 (permalink)
 bfulks 
Boston MA
 
Experience: Advanced
Platform: TradeStation
Trading: Stocks and options
Posts: 24 since Aug 2022
Thanks Given: 2
Thanks Received: 4

I'm not quite clear on what you mean by "days back" but will explain how it works.

On a chart we can see the values of every indicator for all days back from the current date.

When the same indicators run on RadarScreen, it also runs through all the same days as it does on a chart but we normally can only see the values on the last bar, which should be the same as the values on the last bar on the chart. But you can use a print statement to print the values on any dates you want. Here is a simple example:

Vars: Indicator1(0), Indicator2(0), Indicator3(0);

Indicator1 = Average(Close, 20);
Indicator2 = Average(Close, 50);
Indicator3 = Average(Close, 200);

Plot1(Indicator1, "Indicator1");
Plot2(Indicator2, "Indicator2");
Plot3(Indicator3, "Indicator3");

if Date = 1220502 or // Print values on 5/2/22
Date = 1220627 or // Print values on 6/27/22
Date = 1230515 then // Print values on 5/15/23
Print(ELDateToString(Date), Indicator1:10:2, Indicator2:10:2, Indicator3:10:2);

Reply With Quote
  #3 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3



bfulks View Post
I'm not quite clear on what you mean by "days back" but will explain how it works.

On a chart we can see the values of every indicator for all days back from the current date.

When the same indicators run on RadarScreen, it also runs through all the same days as it does on a chart but we normally can only see the values on the last bar, which should be the same as the values on the last bar on the chart. But you can use a print statement to print the values on any dates you want. Here is a simple example:

Vars: Indicator1(0), Indicator2(0), Indicator3(0);

Indicator1 = Average(Close, 20);
Indicator2 = Average(Close, 50);
Indicator3 = Average(Close, 200);

Plot1(Indicator1, "Indicator1");
Plot2(Indicator2, "Indicator2");
Plot3(Indicator3, "Indicator3");

if Date = 1220502 or // Print values on 5/2/22
Date = 1220627 or // Print values on 6/27/22
Date = 1230515 then // Print values on 5/15/23
Print(ELDateToString(Date), Indicator1:10:2, Indicator2:10:2, Indicator3:10:2);


Thank you for your response and for providing the sample code.

Regarding Days Back, it is about settings, and the attached image here is for chart settings, but we would like to make these settings on the radar screen.

Is it possible to do that?





2023-06-27 chart settingsDays Back

Reply With Quote
  #4 (permalink)
 bfulks 
Boston MA
 
Experience: Advanced
Platform: TradeStation
Trading: Stocks and options
Posts: 24 since Aug 2022
Thanks Given: 2
Thanks Received: 4

I understand. Here is the code I use to stop the RadarScreen calculations at some date in the past.
It ends up with the RadarScreen display looking exactly like it did on the past date you select.

I leave the StopDate input set at a far future date ("12/31/30") to keep RadarScreen displaying
the values of today but would set it to "6/5/20" to stop the calculations on that date.

===============================

Input: StopDate("12/31/30");

Vars: LastDate(JulianToDate(StringToDate(StopDate))), Active(TRUE), StopPlots(FALSE);


if Active then begin // Actve is TRUE until calculations are stopped by reaching StopDate
StopPlots = LastBarOnChart or (Active and Date >= LastDate); // Stop calculations on LastDate
// Your code here





if StopPlots then Active = FALSE;
end; // if Active

Reply With Quote
  #5 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3


bfulks View Post
I understand. Here is the code I use to stop the RadarScreen calculations at some date in the past.
It ends up with the RadarScreen display looking exactly like it did on the past date you select.

I leave the StopDate input set at a far future date ("12/31/30") to keep RadarScreen displaying
the values of today but would set it to "6/5/20" to stop the calculations on that date.

===============================

Input: StopDate("12/31/30");

Vars: LastDate(JulianToDate(StringToDate(StopDate))), Active(TRUE), StopPlots(FALSE);


if Active then begin // Actve is TRUE until calculations are stopped by reaching StopDate
StopPlots = LastBarOnChart or (Active and Date >= LastDate); // Stop calculations on LastDate
// Your code here





if StopPlots then Active = FALSE;
end; // if Active


Thank you for your reply.

The attached image here is the result of executing the following code with Interval set to 1 minute and trying to get the data of the past opening price,
I tried the chart and the radar screen and the chart shows the past opening price without any problem, but the radar screen seems to return -1 as the result of the execution.

Is it possible to get the same results on the radar screen as on the chart?



2023-06-27 chart settingsDays Back(Running results on chart and radar screen)



 
Code
Input: StopDate("12/31/30");

Vars: LastDate(JulianToDate(StringToDate(StopDate))), Active(TRUE), StopPlots(FALSE);


if Active then begin // Actve is TRUE until calculations are stopped by reaching StopDate
StopPlots = LastBarOnChart or (Active and Date >= LastDate); // Stop calculations on LastDate
// Your code here

plot1(openD(1));



if StopPlots then Active = FALSE;
end; // if Active

Reply With Quote
  #6 (permalink)
 bfulks 
Boston MA
 
Experience: Advanced
Platform: TradeStation
Trading: Stocks and options
Posts: 24 since Aug 2022
Thanks Given: 2
Thanks Received: 4

There is no way I know of to have RadarScreen stop running at some past date or time.

The code I posted earlier is a way I wrote code to tell it to stop calculating at some past date or time.
This requires you to put the code for the indicator are using in the code I posted.

Reply With Quote
  #7 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

LW11041104,

please keep in mind that Radarscreen will only load the minimum number of bars by default for performance reasons. If you need additional history (which you do for all indicators using historical data in the calculations) Radarscreen has an option to load additional data:

https://help.tradestation.com:443/10_00/eng/tsdevhelp/calculations/loading_additional_data_for_accumulative_calculations.htm

Note that it will only let you specify a certain number of bars back, but not days back.

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #8 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3


bfulks View Post
There is no way I know of to have RadarScreen stop running at some past date or time.

The code I posted earlier is a way I wrote code to tell it to stop calculating at some past date or time.
This requires you to put the code for the indicator are using in the code I posted.


Thank you for your reply.

Is there any alternative?

Reply With Quote
  #9 (permalink)
LW11041104
Tokyo,Sapporo
 
Posts: 74 since Jan 2023
Thanks Given: 2
Thanks Received: 3


ABCTG View Post
LW11041104,

please keep in mind that Radarscreen will only load the minimum number of bars by default for performance reasons. If you need additional history (which you do for all indicators using historical data in the calculations) Radarscreen has an option to load additional data:

https://help.tradestation.com:443/10_00/eng/tsdevhelp/calculations/loading_additional_data_for_accumulative_calculations.htm

Note that it will only let you specify a certain number of bars back, but not days back.

Regards,

ABCTG


Thank you for your response.

So, for example, if 24 hours is represented by 1 minute, it would be 1440 minutes, so would it be possible to get the opening price of the previous day by going back before 1440 bars?

Reply With Quote
  #10 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629


LW11041104,

yes, this should be possible.

Regards,

ABCTG


LW11041104 View Post
Thank you for your response.

So, for example, if 24 hours is represented by 1 minute, it would be 1440 minutes, so would it be possible to get the opening price of the previous day by going back before 1440 bars?


Follow me on Twitter Reply With Quote




Last Updated on June 29, 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