Easy language code ( help )

Ahmad9666

Newbie
Messages
5
Likes
0
Hello,

I am just trying to write an easy language code that ( buy ) if there is a full body green candle,

and (sell) if there is a full body red candle

with target of 2 points .....

and stop = 3 points

can anyone help me ???
 
He did not ask you if it will work smarty. He just asked you for the code. This may be code to add to a larger program. Maybe he is doing it free, piecewise.
 
Hello,

I am just trying to write an easy language code that ( buy ) if there is a full body green candle,

and (sell) if there is a full body red candle

with target of 2 points .....

and stop = 3 points

can anyone help me ???
OK let's go back a step. Look at the attached screenprint. This shows green candles as being up body where the close is greater than the open and red candles as being down body where the close is less than the open.

Is this how you have set up the colouring on your Tradestation ? We need to be talking about the same thing.

Does the wick come into it. What do you mean by FULL body candle. Again we need to be clear about this, because you can set up bars and candles to do almost anything you want.

Although it is not necessary, what instrument are you trading ?

When you say buy if there is a green candle, when do you want to buy and at what price - open of next bar ? Market ? Limit ? etc

Do you want to wait until the current bar is closed for the entry and exit ?

This doesn't seem to be a "real" strategy. Is it ? Or are you just after some code to see how you would go about doing this in Tradestation ?

Have you tried to write any code at all yet ? If so please supply what you wrote.

Once we have answers to these questions we might be able to help. For me it would not be until tomorrow evening as I am veri bizzi at present

Charlton
 

Attachments

  • candlestick.png
    candlestick.png
    52.2 KB · Views: 578
Dear Ahmad9666,

My name is Erik Skyba; I’m the Senior Market Technician here at TradeStation.

In response to your question, I’ve posted the following easy language code below.

In the future, if you have any other questions regarding EasyLanguage, I encourage you to use the EasyLanguage forum on our website. Here is the link: https://www.tradestation.com/Discussions/Forum.aspx?Forum_ID=213

Regards,

Erik Skyba, CMT
Senior Market Technician
TradeStation Securities


Variables: CandleClose( 0 ), CandleOpen( 0 ), CandleHigh( 0 ), CandleLow( 0 ); //Declare Variables

CandleOpen = Open;
CandleClose = Close;
CandleHigh = High;
CandleLow = Low;


//Strategy Rules
If Candleclose > CandleOpen and CandleOpen = CandleLow and CandleClose = CandleHigh
then
buy this bar at close; //Buy for a Green Full Body Candle Condition

If Candleclose < CandleOpen and CandleOpen = CandleHigh and CandleClose = Candlelow
then
sell this bar at close; //Sell for a Red Full Body Candle Condition

//Risk/Profit Control
SetStopShare;//Use the SetStopContract for Futures Contracts
SetStopLoss(3);//3 Point Stop Loss
SetProfitTarget(2)//2 Point Profit Target
 
Hi Ahmed..


Here i would like to say hai and very plr to help u about ur trading concept spacially in Easylanguage coding..... pls consider me as a friend..

Thanks
Prabu
 
Top