NexusFi: Find Your Edge


Home Menu

 





Is this possible to do?


Discussion in MultiCharts

Updated
    1. trending_up 3,263 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 16 posts
    2. attach_file 0 attachments




 
Search this Thread

Is this possible to do?

  #1 (permalink)
 Gibban 
Stockholm
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Trading: Forex
Posts: 14 since Feb 2014
Thanks Given: 25
Thanks Received: 4

Hello all!

I am trying to put together a signal for MC, and can not find anything that can help me at all.

The problem is following:

Buy limit next bar 0,10 * ATR(10)

Code that is not working!
//SetupDay +1 day
If ( RSI_Value <= RSIThreshold ) And ( Close > MA200 ) Then buy next bar at ( ATRBuyLimit );

ATRBuyLimit is a input with (0,10)

Can someone guide me to the right direction?

Best regards
Gibban

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
Futures True Range Report
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Hi Gibban,

can you put in words what you are trying to do?
Your entry price is likely a lot lower than the market price, therefore the limit price won't be executed.
That's why I am asking for your logic, to understand what you are trying to accomplish.

Regards,
ABCTG


Gibban View Post
Hello all!

I am trying to put together a signal for MC, and can not find anything that can help me at all.

The problem is following:

Buy limit next bar 0,10 * ATR(10)

Code that is not working!
//SetupDay +1 day
If ( RSI_Value <= RSIThreshold ) And ( Close > MA200 ) Then buy next bar at ( ATRBuyLimit );

ATRBuyLimit is a input with (0,10)

Can someone guide me to the right direction?

Best regards
Gibban


Follow me on Twitter Reply With Quote
  #3 (permalink)
 Gibban 
Stockholm
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Trading: Forex
Posts: 14 since Feb 2014
Thanks Given: 25
Thanks Received: 4



ABCTG View Post
Hi Gibban,

can you put in words what you are trying to do?
Your entry price is likely a lot lower than the market price, therefore the limit price won't be executed.
That's why I am asking for your logic, to understand what you are trying to accomplish.

Regards,
ABCTG

Thanks for the answer ABCTG!
Yes you are right, the price is little bit lower!
I will try to explain:
Stock closes at 100 to day with ATR(10) of 2,5.
I want to buy the stock next day at 99,75.

Hope this will help!

//gibban

Started this thread Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Gibban,

your code would should look something like this, assuming ATRBuyLimit is a variable.
 
Code
ATRBuyLimit = 0,10 * AvgTrueRange(10) ;

If ( RSI_Value <= RSIThreshold ) And ( Close > MA200 ) Then 
            Buy ("Long") next bar at Close - ATRBuyLimit limit;
Regards,
ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
 Gibban 
Stockholm
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Trading: Forex
Posts: 14 since Feb 2014
Thanks Given: 25
Thanks Received: 4


ABCTG View Post
Gibban,

your code would should look something like this, assuming ATRBuyLimit is a variable.
 
Code
ATRBuyLimit = 0,10 * AvgTrueRange(10) ;

If ( RSI_Value <= RSIThreshold ) And ( Close > MA200 ) Then 
            Buy ("Long") next bar at Close - ATRBuyLimit limit;
Regards,
ABCTG

Thanks ABCTG!
I am getting something wrong, try it in plain English.
Buy Limit = Close - 0,1 * ATR(10)
ProfitTarget = 1 * ATR(10)
StopLoss = 3 *ATR(10)
Exit if TradeDay + 5 sell at market

Seems not so complicated but I am totally stuck....
Here is my code so far:

/gibban

 
Code
Input: {-------------------------------------------------------------------------------------}

RSIThreshold(10),
RSILookback(2),
ATRThreshold(10),
ATRBuyLimit(0.1),
ATRProfitTarget(1),
ATRStoploss(3),
DayExitPeriod(5);

Variables: {---------------------------------------------------------------------------------}

RSI_Value(0),
MA200(0),
ATR(0),
MP(0);

{=== START OF MAIN PROGRAM ================================================================} 


RSI_Value = RSI(Close,RSILookback);
MA200 =  Average(Close, 200);
ATR =  AverageTrueRange(AtrThreshold);
MP = MarketPosition;

//SetupDay +1 day
If ( RSI_Value <= RSIThreshold ) And ( Close > MA200 ) Then 
	Buy ("Long") next bar at Close - ATRBuyLimit limit;
//Exit days
If ( Barssinceentry = DayExitPeriod ) Then sell ("DayExitPeriod") this bar at close;

//Stops
//If ATR <= ATRStoploss Then sell ("ATRStoploss") at market;
//If MP = 1 Then Sell ("AAA") next bar at ( EntryPrice - ( ATRStoploss * ATR) ) limit;

//Target
//If MP = 1 then Sell ("LTarget") Next bar at (EntryPrice + (ATRProfitTarget * ATR)) Limit;

//If ( ATRThreshold <> 0 ) Then SetStopLoss( ATRProfitTarget );



{== END OF MAIN PROGRAM ===================================================================}

Started this thread Reply With Quote
  #6 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Gibban,

with the current code your entry is equal to Close - 0.10, which doesn't seem to be what you have in mind.
As you have the ATR computed and stored within a variable already you can do modify your code to this:
 
Code
//SetupDay +1 day
If ( RSI_Value <= RSIThreshold ) And ( Close > MA200 ) Then 
	Buy ("Long") next bar at Close - ATRBuyLimit * ATR limit;
Regards,
ABCTG


Gibban View Post
Thanks ABCTG!
I am getting something wrong, try it in plain English.
Buy Limit = Close - 0,1 * ATR(10)
ProfitTarget = 1 * ATR(10)
StopLoss = 3 *ATR(10)
Exit if TradeDay + 5 sell at market

Seems not so complicated but I am totally stuck....
Here is my code so far:

/gibban

 
Code
Input: {-------------------------------------------------------------------------------------}

RSIThreshold(10),
RSILookback(2),
ATRThreshold(10),
ATRBuyLimit(0.1),
ATRProfitTarget(1),
ATRStoploss(3),
DayExitPeriod(5);

Variables: {---------------------------------------------------------------------------------}

RSI_Value(0),
MA200(0),
ATR(0),
MP(0);

{=== START OF MAIN PROGRAM ================================================================} 


RSI_Value = RSI(Close,RSILookback);
MA200 =  Average(Close, 200);
ATR =  AverageTrueRange(AtrThreshold);
MP = MarketPosition;

//SetupDay +1 day
If ( RSI_Value <= RSIThreshold ) And ( Close > MA200 ) Then 
	Buy ("Long") next bar at Close - ATRBuyLimit limit;
//Exit days
If ( Barssinceentry = DayExitPeriod ) Then sell ("DayExitPeriod") this bar at close;

//Stops
//If ATR <= ATRStoploss Then sell ("ATRStoploss") at market;
//If MP = 1 Then Sell ("AAA") next bar at ( EntryPrice - ( ATRStoploss * ATR) ) limit;

//Target
//If MP = 1 then Sell ("LTarget") Next bar at (EntryPrice + (ATRProfitTarget * ATR)) Limit;

//If ( ATRThreshold <> 0 ) Then SetStopLoss( ATRProfitTarget );



{== END OF MAIN PROGRAM ===================================================================}


Follow me on Twitter Reply With Quote
Thanked by:
  #7 (permalink)
 Gibban 
Stockholm
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Trading: Forex
Posts: 14 since Feb 2014
Thanks Given: 25
Thanks Received: 4

Looks promising!

Just have to fix the exits, I will dig in.

Regards
Gibban

Started this thread Reply With Quote
  #8 (permalink)
 Gibban 
Stockholm
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Trading: Forex
Posts: 14 since Feb 2014
Thanks Given: 25
Thanks Received: 4

Hi ABCTG!

Can you give me a little hand with the StopLoss function?

Everything is calculated from the closing price on the setup day, and I can not find anything in Easy Language about that at all!

Closing price day X is 100 and ATR[10] is 2, then the StopLoss is suppose to be 93,8.

Best regards
Gibban

Started this thread Reply With Quote
  #9 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,431 since Apr 2013
Thanks Given: 481
Thanks Received: 1,623

Hi Gibban,

are you using the build in reserved word SetStopLoss or your own code?
How do you arrive at 93.8 when the closing price is 100 and the ATR[100] is 2? What is the formula you are using to compute the stop price?

Regards,
ABCTG


Gibban View Post
Hi ABCTG!

Can you give me a little hand with the StopLoss function?

Everything is calculated from the closing price on the setup day, and I can not find anything in Easy Language about that at all!

Closing price day X is 100 and ATR[10] is 2, then the StopLoss is suppose to be 93,8.

Best regards
Gibban


Follow me on Twitter Reply With Quote
  #10 (permalink)
 Gibban 
Stockholm
 
Experience: Beginner
Platform: NinjaTrader, MultiCharts
Trading: Forex
Posts: 14 since Feb 2014
Thanks Given: 25
Thanks Received: 4


Sorry for the late response ABCTG!

Now that you say what is the formula, I realize that I was not one the right way!

The StopLoss is NOT calculated on the Close prize of the setup bar it is calculated on the BuyLimitPrice.

Conditions:
ClosePrice of stock X is = 100
ATR(10) is = 2

Formula for the BuyLimitPrice:
ClosePrice - 10% of the ATR (100-0,1*2) = BuylimitPrice (99,8)

Formula for the StopLossPrice:
BuyLimitPrice - 3 *ATR (99,8-3*2) = StopLossPrice (93,8)

Hope this helps!
Regards
Gibban

Started this thread Reply With Quote




Last Updated on May 30, 2014


© 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