Experienced thinkscript developper to perform 4 tasks

Other Other

Specification

Task #1 Consolidation of TD Sequence Count.

Below there are 4 scripts for the TOS scanner. The Scripts search and find stocks with a demark 9 and 13 count. It uses the native TOS TD Sequence counter. The 4 scripts represent;

1)      A daily Long 9 count finder

2)      A daily Long 13 count finder

3)      A daily short (sell) 9 count finder

4)      A daily short(sell) 13 count finder

The first task is to combine these indicators So I can use less scanners and respective watchlist.

The output would result in the following Deliverables;

1)      A single combined script that generates Daily long 9 and Daily long 13 in one scan script.

2)      A single combined script that generates Daily short 9 and Daily short13 in one scan script.

3)      A single combined script that generates Daily long 9, Daily long 13, daily short 9, daily short 13 all 4 in in one scan script.

Of course the key is to test these scripts because we’ve noticed that on “All stocks” many complex scripts fail.

Here are the four scripts

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

9 COUNT LONG

def data1 = reference sequenceCounter(13,9)."Perfect buy";

def data2=if IsNaN(data1) then 0 else data1;

def data3=if IsNaN(data2) then data3[1] else data2;

plot ret=data3 or data3[1] or data3[2] or data3[3] or data3 [4];

 

13 COUNT LONG

def data1 = reference sequenceCounter(13,9)."Perfect array buy";

def data2=if IsNaN(data1) then 0 else data1;

def data3=if IsNaN(data2) then data3[1] else data2;

plot ret=data3 or data3[1] or data3[2] or data3[3] or data3[4];

9 COUNT SHORT

def data1 = reference sequenceCounter(13,9)."Perfect sell";

def data2=if IsNaN(data1) then 0 else data1;

def data3=if IsNaN(data2) then data3[1] else data2;

plot ret=data3 or data3[1] or data3[2] or data3[3];

13 COUNT SHORT

def data1 = reference sequenceCounter(13,9)."Perfect array sell";

def data2=if IsNaN(data1) then 0 else data1;

def data3=if IsNaN(data2) then data3[1] else data2;

plot ret=data3 or data3[1] or data3[2] or data3[3] or data3[4];

 

 

Task #2  Intraday TD sequence count

The Native Sequence counter in TOS does not work properly intraday in timeframes lower than daily like 4 hours or 30 minutes.  We are proposing to use this similar Sequence counter external custom code below to create a scan that works intraday. Of course the Devil is in the testing until it is reliable.

The desired output is the following deliverables using the custom code below on intraday timeframes.

1)      A single combined script that generates intraday long 9 and intraday long 13 in one scan script.

2)      A single combined script that generates intraday short 9 and intraday short13 in one scan script.

3)      A single combined script that generates intraday long 9, intraday long 13, intraday short 9, intraday short 13 all 4 in in one scan script.

Of course the key is to test these scripts because we’ve noticed that on “All stocks” many complex scripts fail.  Here is the indicator code below.

 

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

CODE:

## "##" indicates an addition or adjustment by the OneNote Archivist

## Original Code Follows

#Dilbert_SC

# V1.5 - 021117 - Dilbert - Inputs to move arrows and bubbles

# V1.4 - 121316 - Dilbert - Make Length2 bubble color.cyan

# V1.3 - 121316 - Dilbert - Add 9 count support resistance line, and 13 count risk line.  Use same colors as vertical lines.

# V1.2 - 121016 - Dilbert - Use Length1/Length2 all the time instead of hardcode.

# V1.1 - 121016 - Dilbert - UT13Bar/DT13Bar only if UT13/DT13 == 1

# V1.0 - 121016 - Dilbert - 1st code cut, beta version still

 

# Posted by Amalia on 03.02.2018

#Hint Length1: Number of bars in setup

input Length1 = 9;

#Hint Length2: Number of bars in countdown

input Length2 = 13;

#Hint HorizontalLines: 1 == show, 0 == hide

input HorizontalLines = 1;

#Hint Bubbles: 1 == show, 0 == hide

input Bubbles = 1;

def H = high;

def L = low;

def C = close;

def BN = BarNumber();

def TS = TickSize();

input BubbleMult = 10;   # Move Bubble up/down

input ArrowMult = 50;  # Move Arrow up/down

#######################################################################################

#  Count to 9 with down trend

def DT9 = if C < C[4] then 1 else 0;

def DT9Sum = if DT9 == 0

then 0

else if DT9Sum[1] == Length1 and DT9 == 1  # if we reach 9 count to 9 again

then 1

else DT9Sum[1] + DT9;

#plot DT9Sum2 = DT9Sum;

def DT9Sum2 = DT9Sum;

plot DT9SumP = if DT9Sum != 0

              and DT9Sum < Length1 + 1

then DT9Sum

else Double.NaN;

DT9SumP.SetPaintingStrategy(paintingStrategy = PaintingStrategy.VALUES_BELOW);

DT9SumP.AssignValueColor(Color.WHITE);

 

######################################################################################

#

#  Count to 9 with up trend

def UT9X = if C > C[4] then 1 else 0;

def UT9 = if UT9X == 1

then 1

else if UT9X == 1

then 1

else 0;

def UT9Sum = if UT9 == 0

then 0

else if UT9Sum[1] == Length1 and UT9 == 1 # if we reach 9 count to 9 again

then 1

else UT9Sum[1] + UT9;

def UT9Sum2 = UT9Sum;

plot UT9SumP = if UT9Sum != 0

              and UT9Sum < Length1 + 1

then UT9Sum

else Double.NaN;

UT9SumP.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

UT9SumP.AssignValueColor(Color.GRAY);

 

#####################################################################################

# UT9Bar/DT9BAR logic

def DT9Bar = if DT9Sum == Length1 then BN else DT9Bar[1];

def UT9Bar = if UT9Sum == Length1 then BN else UT9Bar[1];

# Cancel the countdown if the opposite pattern is found

def DT9Active = if DT9Bar == BN then 1

           else if UT9Bar == BN then 0

                                else DT9Active[1];

def UT9Active = if UT9Bar == BN then 1

           else if DT9Bar == BN then 0

                                else UT9Active[1];

#####################################################################################

# 9 count trend lines

def UTH9 = if UT9Bar == BN then Highest(H,9) else UTH9[1];

def DTH9 = if DT9Bar == BN then Highest(H,9) else DTH9[1];

def UTL9 = if UT9Bar == BN then Lowest(L,9) else UTL9[1];

def DTL9 = if DT9Bar == BN then Lowest(L,9) else DTL9[1];          

plot UTH9P = if HorizontalLines then UTH9 else Double.NaN;

plot DTH9P = if HorizontalLines then DTH9 else Double.NaN;

plot UTL9P = if HorizontalLines then UTL9 else Double.NaN;

plot DTL9P = if HorizontalLines then DTL9 else Double.NaN;

UTH9P.SetDefaultColor(Color.Cyan);

DTH9P.SetDefaultColor(Color.Orange);

UTL9P.SetDefaultColor(Color.GRAY);

DTL9P.SetDefaultColor(Color.Orange);

#####################################################################################

# Count to 13 in down trend

 

def DT13 = if BN >= DT9Bar and DT9Active == 1 and C <= L[2] then 1 else 0;

def DT13Sum = if DT9Bar == BN

then DT13

else DT13Sum[1] + DT13;

def DT13SumP = if DT13Sum != 0

               and DT13Sum < Length2 + 1

               and DT13Sum != DT13Sum[1]

then DT13Sum

else Double.NaN;

AddChartBubble(DT13Sum != 0 and Bubbles == 1

           and DT13Sum < Length2 + 1

           and DT13Sum != DT13Sum[1], L - TS * BubbleMult, DT13Sum, if DT13Sum == Length2 then Color.Cyan else Color.GREEN, no);

#####################################################################################

#  Down Trend 13 risk line

 

def DT13LL;

def DT13LLBarRange;

if DT9Bar == BN

then {

DT13LL = L;

DT13LLBarRange = H - L;

}

 

else if DT9Active and DT13Sum <= 13 and DT13 == 1 and L < DT13LL[1]

then {

DT13LL = L;

DT13LLBarRange = H - L;

}

else {

DT13LL = DT13LL[1];

DT13LLBarRange = DT13LLBarRange[1];

};

plot DT13Risk = if HorizontalLines then DT13LL - DT13LLBarRange else Double.NaN;

DT13Risk.SetDefaultColor(Color.Green);

 

#####################################################################################

# Count to 13 in up trend

def UT13 = if BN >= UT9Bar and UT9Active == 1 and C >= H[2] then 1 else 0;

def UT13Sum = if UT9Bar == BN

then UT13

else UT13Sum[1] + UT13;

 

def UT13SumP = if UT13Sum != 0

               and UT13Sum < Length2 + 1

               and UT13Sum != UT13Sum[1]

then UT13Sum

else Double.NaN;

AddChartBubble(UT13Sum != 0 and Bubbles == 1

           and UT13Sum < Length2 + 1

           and UT13Sum != UT13Sum[1], H + TS * BubbleMult, UT13Sum, if UT13Sum == Length2 then Color.Cyan else Color.RED, yes);

#####################################################################################

#  Up Trend 13 risk line

 

def UT13HH;

def UT13HHBarRange;

if UT9Bar == BN

then {

UT13HH = H;

UT13HHBarRange = H - L;

}

else if UT9Active and UT13Sum <= Length2 and UT13 == 1 and H > UT13HH[1]

then {

UT13HH = H;

UT13HHBarRange = H - L;

}

else {

UT13HH = UT13HH[1];

UT13HHBarRange = UT13HHBarRange[1];

};

plot UT13Risk = if HorizontalLines then UT13HH + UT13HHBarRange else Double.NaN;

UT13Risk.SetDefaultColor(Color.Red);

#####################################################################################

# UT13Bar/DT13BAR logic

def DT13Bar = if DT13Sum == Length2 and DT13 == 1 then BN else DT13Bar[1];

def UT13Bar = if UT13Sum == Length2 and UT13 == 1 then BN else UT13Bar[1];

# Cancel the countdown if the opposite pattern is found

#def DT13Active = if DT9Bar == BN then 1

#           else if UT9Bar == BN then 0

#                                else DT13Active[1];

#def UT13Active = if UT9Bar == BN then 1

#           else if DT9Bar == BN then 0

#                                else UT13Active[1];

######################################################################################

#Perfect 9 down trend logic

plot P9Buy = if DT9Bar == BN and (L < L[2] and L < L[3] or L[1] < L[2] and L[1] < L[3])

            then L - TS * ArrowMult else Double.NaN;

P9Buy.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

P9Buy.AssignValueColor(Color.YELLOW);

######################################################################################

######################################################################################

#Perfect 9 up trend logic

plot P9Sell = if UT9Bar == BN and (H > H[2] and high > high[3] or H[1] > H[2] and H[1] > high[3]) then H + TS * ArrowMult else Double.NaN;

P9Sell.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

P9Sell.AssignValueColor(Color.ORANGE);

 

######################################################################################

#Perfect 13 down trend logic

plot P13Buy = if DT13Bar == BN and L <= C[5] then L - TS * ArrowMult else Double.NaN;

 

P13Buy.SetPaintingStrategy(PaintingStrategy.ARROW_Up);

P13Buy.AssignValueColor(Color.RED);

######################################################################################

#Perfect 13 up trend logic

plot P13Sell = if UT13Bar == BN and H >= C[5]then H + TS * ArrowMult else Double.NaN;

P13Sell.SetPaintingStrategy(PaintingStrategy.ARROW_Down);

P13Sell.AssignValueColor(Color.RED);

 

AddVerticalLine(DT9Bar == BN, "", Color.ORANGE, curve.SHORT_DASH);

AddVerticalLine(UT9Bar == BN, "", Color.Cyan, curve.SHORT_DASH);

AddVerticalLine(DT13Bar == BN, "", Color.Green, curve.SHORT_DASH);

AddVerticalLine(UT13Bar == BN, "", Color.Red, curve.SHORT_DASH);

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

Task #3 -Relative Volume  Fix

The code below simply compares the volume of the last 20 days and creates a volume average for the period. Then it compares the current day against this average. If it is greater than 5 times the average it colors it green.

There are bugs in the results generated by this code. Sometimes you get “NAN” or just blanks when the data is there.  The color is generated slowly so if we can speed it up it would solve the paint latency.

We also need a sub window bar indicator for chart use of this code as well as a scan script.

Here is the code below

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

 # START

plot c = Volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 20);

c.SetDefaultColor(Color.BLACK);

AssignBackgroundColor(if c > 5 then Color.LIGHT_GREEN else Color.PINK);

# END

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

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

Task 4. Overnight volume column and relative volume column, scan, chart code.

Using the existing code below, but must be modified to only consider the volume in the overnight sessions. For instance, if the aggregation period is set to 20, you should only consider the volume from the most recent 20 overnight sessions. These sessions are defined as starting a4:00 AM ending 9:30 AM. This is mostly for stocks.

Deliverables should output  chart, column code, as well as  scan code. The chart code should be combined with the RH code. The system should be able to identify if it's operating during after-hours (AH) and adjust the logic accordingly."

 

 

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

CODE

 # START

plot c = Volume(period = AggregationPeriod.DAY) / Average(volume(period = AggregationPeriod.DAY), 20);

c.SetDefaultColor(Color.BLACK);

AssignBackgroundColor(if c > 5 then Color.LIGHT_GREEN else Color.PINK);

# END

 


Responded

1
Developer 1
Rating
(185)
Projects
189
26%
Arbitration
0
Overdue
3
2%
Free
2
Developer 2
Rating
(62)
Projects
84
26%
Arbitration
22
23% / 50%
Overdue
23
27%
Free
Similar orders
A developer is sought to modify an existing EA. The changes to be made are on money management, adding an indicator between conditions, and (not essential) in adding a news filter. EA already works correctly but needs to be optimized
I am looking for a coder to help me code my custom Ninjatrader 8 strategy and make it work perfectly without any error, your expertise is highly needed in this job kindly reach out to me and let proceed
Hello I am looking for a professional in building a stock trading robot and make it work perfectly Specifically, I want to build a robot for trading in options from the IOF your expertise is highly needed in this project Kindly reach out and let proceed
When passing this indicator, the distances of the intersections cannot be important. i.e. if the approach of the ema characters that I have set in the graph converges at a distance, it should be shown to me correctly. it should show the convergence lines of the two intersections without or without the proximity and distance setting and give the necessary time warning.First of all, each ema intersection may need to be
Hello I have a TradingView indicator that is very accurate can you create a bot on NinjaTrader to help me make profitable trades. It is needed urgently if you can help me with this project kindly give me an answer in the comment session
I need Copy Trade program on MT5 to MT5 With Some Condition..... 1. Trade must be on Reverse (IF Master Buy then On Slave is Sell) 2. Custom Lots Size on Slave 3. Symbols Adjustment 4. TP and SL (on Slave TP and SL +.50 Added) 5. Open and Closed Order on Same time(Also On market Condition)
MT5 Broker Research 50 - 100 USD
Looking For Someone With Good knowledge of Available MT5 Brokers to help with MT5 Demo Account research. The Objective of the research is to gather data on trading environment in each MT5 demo account by downloading the demo and accessing such factors as. 1 ) Number Of Trading Sectors Covered, example , Forex, Futures, Commodities, Stocks and Global Region Of Stocks etc 2) Total Number Of Symbols In Market Watch 3)
Hi, I need someone that can help me with a script in python for $SPY option strategy. Kindly let me know if you can and we proceed. It is needed urgently if you can do this project kindly drop a message in the comment sessions
Looking for a well versed Tradingview and python expert with good reviews to take up this project I have multiple watchlists with 10-50 stocks in each watchlist I have an indicator (pine script ) Plus 2-3 other parameters can we code an indicator or a system in python or wherever , giving alert every 15 mins and scanning for all buy signals every 15 mins ?? any platform .. python / excel / vb/ trading view
I want to develop metatrader to trading bot and i want an expert that has experience in this field that can do the work perfect well for me without error

Project information

Budget
90+ USD
For the developer
81 USD