Jump to content

(REQ) Help Trasnforming this TS Code into NT Code


LonelyTrade

Recommended Posts

Hi Again,

 

Can a good sould here help us by transforming this TS Code into NT Code, this indicator is for scalping even with 1 tick charts. some one please!!!

 

Thank you!

 

The code is:

 

{Scalper Buys and Sells 7/18/2007

Written by Luis Gomez

inspired by John Carters "Mastering the Trade"

}

 

inputs:

buyColor(white),

sellColor(blue),

width(3);

variables:

highBarsAgo(1),

possibleHighBarsAgo(1),

possibleHigh(-2),

hightoBeat(-1),

barsSincePaint(1),

lowBarsAgo(1),

possibleLowBarsAgo(1),

possibleLow(10000001),

lowtoBeat(10000000),

triggerPriceSell(-1),

triggerPriceBuy(1000000),

trend(1),

_UP(1),

_DOWN(-1),

_ON(1),

_OFF(-1);

 

 

//************************* ************************* *

//****** Find and plot the highest swing high *******

//************************* ************************* *

 

if trend = _UP then begin

if swingHighBar(1,H,2,barsSi ncePaint+2) > -1 then begin

possibleHighBarsAgo = swingHighBar(1,H,2,barsSi ncePaint+2);

possibleHigh = H[possibleHighBarsAgo];

end;

 

if possibleHigh >= hightoBeat then begin

highBarsAgo = possibleHighBarsAgo;

hightoBeat = possibleHigh;

triggerPriceSell = L[HighBarsAgo - 1];

end;

 

if C < triggerPriceSell and

highest(high,highBarsAgo) < hightoBeat then begin

plotpb[highBarsAgo](H[highBarsAgo],L[highBarsAgo],"",sellColor);

alert("Scalper Sell");

trend = _DOWN;

barsSincePaint = highBarsAgo-1;

hightoBeat = -1;

lowtoBeat = 10000000;

triggerPriceBuy = 10000000;

triggerPriceSell = -1;

highBarsAgo = 1;

possibleHigh = -2;

end;

 

end;

 

//************************* ************************* *

//****** Find and plot the lowest swing low *********

//************************* ************************* *

 

if trend = _DOWN then begin

if swingLowBar(1,L,2,barsSin cePaint+2) > -1 then begin

possibleLowBarsAgo = swingLowBar(1,L,2,barsSin cePaint+2);

possibleLow = L[possibleLowBarsAgo];

end;

 

if possibleLow <= lowtoBeat then begin

lowBarsAgo = possibleLowBarsAgo;

lowtoBeat = possibleLow;

triggerPriceBuy = H[LowBarsAgo - 1];

end;

 

if C > triggerPriceBuy and

lowest(L,lowBarsAgo) > lowtoBeat then begin

plotpb[lowBarsAgo](H[lowBarsAgo],L[lowBarsAgo],"",buyColor);

alert("Scalper Buy");

trend = _UP;

barsSincePaint = lowBarsAgo-1;

possibleLow = 10000001;

lowtoBeat = 10000000;

hightoBeat = -1;

triggerPriceBuy = 10000000;

triggerPriceSell = -1;

lowBarsAgo = 1;

end;

 

end;

 

barsSincePaint = barsSincePaint+1;

if trend = _UP then highBarsAgo = highBarsAgo + 1;

if trend = _DOWN then lowBarsAgo = lowBarsAgo + 1;

setPlotWidth(1,width);

Link to comment
Share on other sites

Hi Again,

 

Can a good sould here help us by transforming this TS Code into NT Code, this indicator is for scalping even with 1 tick charts. some one please!!!

 

Thank you!

 

The code is:

 

{Scalper Buys and Sells 7/18/2007

Written by Luis Gomez

inspired by John Carters "Mastering the Trade"

}

 

inputs:

buyColor(white),

sellColor(blue),

width(3);

variables:

highBarsAgo(1),

possibleHighBarsAgo(1),

possibleHigh(-2),

hightoBeat(-1),

barsSincePaint(1),

lowBarsAgo(1),

possibleLowBarsAgo(1),

possibleLow(10000001),

lowtoBeat(10000000),

triggerPriceSell(-1),

triggerPriceBuy(1000000),

trend(1),

_UP(1),

_DOWN(-1),

_ON(1),

_OFF(-1);

 

 

//************************* ************************* *

//****** Find and plot the highest swing high *******

//************************* ************************* *

 

if trend = _UP then begin

if swingHighBar(1,H,2,barsSi ncePaint+2) > -1 then begin

possibleHighBarsAgo = swingHighBar(1,H,2,barsSi ncePaint+2);

possibleHigh = H[possibleHighBarsAgo];

end;

 

if possibleHigh >= hightoBeat then begin

highBarsAgo = possibleHighBarsAgo;

hightoBeat = possibleHigh;

triggerPriceSell = L[HighBarsAgo - 1];

end;

 

if C < triggerPriceSell and

highest(high,highBarsAgo) < hightoBeat then begin

plotpb[highBarsAgo](H[highBarsAgo],L[highBarsAgo],"",sellColor);

alert("Scalper Sell");

trend = _DOWN;

barsSincePaint = highBarsAgo-1;

hightoBeat = -1;

lowtoBeat = 10000000;

triggerPriceBuy = 10000000;

triggerPriceSell = -1;

highBarsAgo = 1;

possibleHigh = -2;

end;

 

end;

 

//************************* ************************* *

//****** Find and plot the lowest swing low *********

//************************* ************************* *

 

if trend = _DOWN then begin

if swingLowBar(1,L,2,barsSin cePaint+2) > -1 then begin

possibleLowBarsAgo = swingLowBar(1,L,2,barsSin cePaint+2);

possibleLow = L[possibleLowBarsAgo];

end;

 

if possibleLow <= lowtoBeat then begin

lowBarsAgo = possibleLowBarsAgo;

lowtoBeat = possibleLow;

triggerPriceBuy = H[LowBarsAgo - 1];

end;

 

if C > triggerPriceBuy and

lowest(L,lowBarsAgo) > lowtoBeat then begin

plotpb[lowBarsAgo](H[lowBarsAgo],L[lowBarsAgo],"",buyColor);

alert("Scalper Buy");

trend = _UP;

barsSincePaint = lowBarsAgo-1;

possibleLow = 10000001;

lowtoBeat = 10000000;

hightoBeat = -1;

triggerPriceBuy = 10000000;

triggerPriceSell = -1;

lowBarsAgo = 1;

end;

 

end;

 

barsSincePaint = barsSincePaint+1;

if trend = _UP then highBarsAgo = highBarsAgo + 1;

if trend = _DOWN then lowBarsAgo = lowBarsAgo + 1;

setPlotWidth(1,width);

 

Hi try with this https://www.sendspace.com/file/9okx76

 

copy the cs. file in your C:\Users\...\Documents\NinjaTrader 7\bin\Custom\Indicator and compile it

 

enjoy

 

regards

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...