NexusFi: Find Your Edge


Home Menu

 





Convert TS code for TheStrat (Rob Smith) to MC


Discussion in MultiCharts

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




 
Search this Thread

Convert TS code for TheStrat (Rob Smith) to MC

  #1 (permalink)
 Prototyper 
Reno Nevada
 
Experience: Intermediate
Platform: In flux
Trading: in Flux
Posts: 35 since Dec 2016
Thanks Given: 7
Thanks Received: 31

Attached, please find an ELD file I downloaded from the Facebook group for TheStrat (aka Rob Smith's method of trading or Smith's In The Black)

the code is also pasted below.

Apparently, the way its written, it will compile only in Tradestation and not MC. I'm not a programmer. I can sometimes cobble together simple code for indicators in MC.

I'm requesting help to convert the code so that it works in MC, or at least strip out the part of the code that can execute in MC, and the other fancier features (ie Radar Screen) will have be done manually. I think there is code for screening all stock tickers, but that doesn't interest me, as I prefer to trade only futures.

The end result I am looking for here is code that works in MC and paints/identifies the Rob Smith reversals on whatever bar chart I apply this indicator/paint bar study to.

A request for help in the MC forum didn't yield much.

 
Code
#region - Documentation -
{
---------------------------------------------------------------------------------------------------
IDENTIFICATION
==============
Name:			RS_TheSTRAT
Type:			Indicator
TS Version:		9.5 Build 26 or later
  
---------------------------------------------------------------------------------------------------
CRITICAL INFO
=============
*    Be sure that "Update value intra-bar (tick-by-tick) IS NOT CHECKED

DOCUMENTATION
=============
This indicator will label the bars with a number indicating one of the following conditions:

* 	If the current bars High or Low is equal OR does not exceed the previous bar's High OR Low, it will be a "1" (Inside Bar)
*	If a candle exceeds the High OR the Low of the previous bar BUT not both, it will be a "2" (Note, equal to prev H/L does not count as exceeds)
*	If a candle exceeds both the High and the Low of the previous bar it will be a "3"  (Outside Bar)

*   Added (4/24/2020 by JPoole) - If bar scores a "2" as stated above, then also need to determine if it is a "2Up" or "2Dn"
    2Up = Any bar that scores a 2 AND Makes a Higher High than the prev bar - Change color of text label to "Green"
    2Dn = Any bar that scores a 2 AND makes a Lower Low than the prev bar - Change color of text label to "Red"

*   To Be Added - RadarSceen Plots - Conditions & Alerts for each of the following;
    Single Bar Condition:
    Current Condition (i.e. 1, 2Up or 2Dn, 3)
    Multi-Bar Alerts:
    2Up/1/2Up = "Bullish Continuation Condition"
    2Dn/1/2Dn = "Bearish Continuation Condition"
    2Up/2Dn = "2 Bar Bearish Reversal Condition"
    2Dn/2Up = "2 Bar Bullish Reversal Condition"
    1/2Up/2Dn = "3 Bar Bearish Reversal Condition"
    1/2Dn/2Up = "3 Bar Bullish Reversal Condition"
    
*   To be Added - Is there a way to remove the "Exceeded 5000 text objects" warning, it may be annoying to some users
    
---------------------------------------------------------------------------------------------------
}
#endregion

#region - History -
{
---------------------------------------------------------------------------------------------------
HISTORY
=======
Date		Version		Task
---------	--------	-------------------------------------------------------------------
03/26/20	01.00.00	* Created 
							
---------------------------------------------------------------------------------------------------
TO DO LIST
==========
Date		Version		Task
---------	--------	-------------------------------------------------------------------

---------------------------------------------------------------------------------------------------
}
#endregion

#region - Usings -
using elsystem;
using elsystem.collections;
using elsystem.drawing;
using elsystem.drawingobjects;
#endregion

#region - Inputs_Study -
inputs:
	int iMaxBars(100),
	string iLabelColor("Magenta"),
	float iFontSize(8);
#endregion

#region - Variables_Study -
variables:
	Vector TxtLbls(null),
	TextLabel TxtLbl(null),
	intrabarpersist int LastBar(0),
	string STRAT_State("");
#endregion

method TextLabel AddLabel()
variables:
	TextLabel TX;
begin
	TX = TextLabel.Create();
	TX.Color = Color.FromName(iLabelColor);
	TX.Font = Font.Create(TX.Font.Name, iFontSize, FontStyle.Regular);
	TX.HStyle = HorizontalStyle.Center;
	TX.VStyle = VerticalStyle.Center;
	TX.Lock = true;
	TX.Name = string.format("{0}", CurrentBar);
	TX.Persist = true;
	TX.PointValue = BNPoint.Create(CurrentBar + MaxBarsBack - 1, High + .10);
	TX.TextString = STRAT_State;

	DrawingObjects.Add(TX);
	return TX;
end;

once
begin
	TxtLbls = vector.create();
end;

//	Determine Value to be displayed

STRAT_State = "";

if High <= High[1]
	and Low >= Low[1] then
begin
	STRAT_State = "1";
	Plot1(STRAT_State, "1", White, Default, 2);
	Print("1");
	Alert("1");
end

else if (High > High[1] and Low >= Low[1] )Then
begin
	STRAT_State = "2U";
	Plot2(STRAT_State, "2U", White, Default, 2);
	Print("2U");
	Alert("2U");
end

else if (High <= High[1] and Low < Low[1] ) then
begin
	STRAT_State = "2D";
	Plot3(STRAT_State, "2D", White, Default, 2);
	Print("2D");
	Alert("2D");
end

else if High > High[1] and Low < Low[1] then
begin
	STRAT_State = "3";
	Plot4(STRAT_State, "3", White, Default, 2);
	Print("3");
	Alert("3");
end;

if STRAT_State.Length > 0 then
begin
	AddLabel();
end;


if iMaxBars > 0 then
begin
	if CurrentBar > LastBar then
	begin
		LastBar = CurrentBar;
		TxtLbl = AddLabel();
		TxtLbls.Push_Back(TxtLbl);
		
		while TxtLbls.count > iMaxBars
		begin
			DrawingObjects.Delete(TxtLbls[0] astype TextLabel);
			TxtLbls.erase(0);
		end;
	end
	
	//	Position Label
	else if TxtLbl <> null then
	begin
		TxtLbl.PointValue = BNPoint.Create(CurrentBar + MaxBarsBack - 1, (Open + Close) / 2);
		end;
	
end;

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
What broker to use for trading palladium futures
Commodities
Trade idea based off three indicators.
Traders Hideout
Cheap historycal L1 data for stocks
Stocks and ETFs
 
  #2 (permalink)
 bob314159 
boulder, colorado
 
Experience: Advanced
Platform: TradeStation
Trading: emini's
Posts: 56 since Jun 2010
Thanks Given: 3
Thanks Received: 63

How does one get into the FB The Strat group?

Reply With Quote
  #3 (permalink)
 Prototyper 
Reno Nevada
 
Experience: Intermediate
Platform: In flux
Trading: in Flux
Posts: 35 since Dec 2016
Thanks Given: 7
Thanks Received: 31



bob314159 View Post
How does one get into the FB The Strat group?

You can request to join
https://www.facebook.com/groups/TheStrat

Started this thread Reply With Quote
Thanked by:




Last Updated on August 23, 2020


© 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